
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: 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+28) (not (<= z 2.3e-178))) (* (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) (/ 1.0 c)) (/ (+ b (fma x (* 9.0 y) (* t (* z (* -4.0 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.5e+28) || !(z <= 2.3e-178)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (b + fma(x, (9.0 * y), (t * (z * (-4.0 * 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.5e+28) || !(z <= 2.3e-178)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) * Float64(1.0 / c)); else tmp = Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(t * Float64(z * Float64(-4.0 * a))))) / 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+28], N[Not[LessEqual[z, 2.3e-178]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(z * N[(-4.0 * a), $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^{+28} \lor \neg \left(z \leq 2.3 \cdot 10^{-178}\right):\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(z \cdot \left(-4 \cdot a\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.49999999999999979e28 or 2.29999999999999994e-178 < z Initial program 66.1%
associate-+l-66.1%
div-sub62.5%
*-commutative62.5%
associate-*r*61.0%
*-commutative61.0%
div-sub64.7%
associate-+l-64.7%
Simplified68.3%
Applied egg-rr79.6%
Taylor expanded in x around 0 90.0%
if -2.49999999999999979e28 < z < 2.29999999999999994e-178Initial program 99.0%
associate-+l-99.0%
div-sub83.9%
*-commutative83.9%
associate-*r*83.9%
*-commutative83.9%
div-sub98.2%
associate-+l-98.2%
Simplified98.3%
Final simplification93.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 (or (<= z -4e+22) (not (<= z 2.3e-178))) (* (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) (/ 1.0 c)) (/ (+ b (- (* y (* 9.0 x)) (* 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 <= -4e+22) || !(z <= 2.3e-178)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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 <= (-4d+22)) .or. (.not. (z <= 2.3d-178))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) * (1.0d0 / c)
else
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (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 <= -4e+22) || !(z <= 2.3e-178)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -4e+22) or not (z <= 2.3e-178): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c) else: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -4e+22) || !(z <= 2.3e-178)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) * Float64(1.0 / c)); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(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 <= -4e+22) || ~((z <= 2.3e-178)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
else
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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, -4e+22], N[Not[LessEqual[z, 2.3e-178]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+22} \lor \neg \left(z \leq 2.3 \cdot 10^{-178}\right):\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4e22 or 2.29999999999999994e-178 < z Initial program 66.6%
associate-+l-66.6%
div-sub63.0%
*-commutative63.0%
associate-*r*60.9%
*-commutative60.9%
div-sub64.5%
associate-+l-64.5%
Simplified68.7%
Applied egg-rr79.9%
Taylor expanded in x around 0 90.1%
if -4e22 < z < 2.29999999999999994e-178Initial program 99.0%
Final simplification94.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 (if (or (<= z -1.35e+166) (not (<= z 2.7e+100))) (/ (+ (* -4.0 (* a t)) (/ b z)) c) (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* a t)))) (* 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 <= -1.35e+166) || !(z <= 2.7e+100)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (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 <= (-1.35d+166)) .or. (.not. (z <= 2.7d+100))) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c
else
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (a * t)))) / (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 <= -1.35e+166) || !(z <= 2.7e+100)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (z * c);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.35e+166) or not (z <= 2.7e+100): tmp = ((-4.0 * (a * t)) + (b / z)) / c else: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (z * c) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.35e+166) || !(z <= 2.7e+100)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(a * t)))) / 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 <= -1.35e+166) || ~((z <= 2.7e+100)))
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
else
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (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, -1.35e+166], N[Not[LessEqual[z, 2.7e+100]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $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[(a * t), $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 -1.35 \cdot 10^{+166} \lor \neg \left(z \leq 2.7 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.35000000000000006e166 or 2.69999999999999998e100 < z Initial program 53.8%
associate-+l-53.8%
div-sub52.3%
*-commutative52.3%
associate-*r*49.5%
*-commutative49.5%
div-sub50.9%
associate-+l-50.9%
Simplified55.1%
Applied egg-rr75.5%
Taylor expanded in x around 0 94.2%
Taylor expanded in x around 0 82.4%
if -1.35000000000000006e166 < z < 2.69999999999999998e100Initial program 92.0%
associate-+l-92.0%
div-sub80.1%
*-commutative80.1%
associate-*r*80.2%
*-commutative80.2%
div-sub91.6%
associate-+l-91.6%
Simplified91.1%
Final simplification88.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.75e+132) (not (<= z 9e+105))) (/ (+ (* -4.0 (* a t)) (/ b z)) c) (/ (+ b (- (* y (* 9.0 x)) (* 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.75e+132) || !(z <= 9e+105)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.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) :: tmp
if ((z <= (-2.75d+132)) .or. (.not. (z <= 9d+105))) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c
else
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.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 tmp;
if ((z <= -2.75e+132) || !(z <= 9e+105)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2.75e+132) or not (z <= 9e+105): tmp = ((-4.0 * (a * t)) + (b / z)) / c else: tmp = (b + ((y * (9.0 * x)) - (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.75e+132) || !(z <= 9e+105)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / 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.75e+132) || ~((z <= 9e+105)))
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
else
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.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_] := If[Or[LessEqual[z, -2.75e+132], N[Not[LessEqual[z, 9e+105]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+132} \lor \neg \left(z \leq 9 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.75e132 or 9.0000000000000002e105 < z Initial program 57.7%
associate-+l-57.7%
div-sub56.5%
*-commutative56.5%
associate-*r*54.0%
*-commutative54.0%
div-sub55.2%
associate-+l-55.2%
Simplified60.1%
Applied egg-rr78.2%
Taylor expanded in x around 0 94.8%
Taylor expanded in x around 0 81.9%
if -2.75e132 < z < 9.0000000000000002e105Initial program 92.2%
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
(if (<= b -540000000000.0)
(/ (/ 1.0 z) (/ c b))
(if (<= b -2.8e-216)
(* -4.0 (* t (/ a c)))
(if (<= b -1.45e-260)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= b 4.25e-306)
(* -4.0 (/ t (/ c a)))
(if (<= b 1.5e-200)
(* 9.0 (/ (* x y) (* z c)))
(if (<= b 7.2e+46) (* -4.0 (/ a (/ c t))) (/ (/ 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 (b <= -540000000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -2.8e-216) {
tmp = -4.0 * (t * (a / c));
} else if (b <= -1.45e-260) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 4.25e-306) {
tmp = -4.0 * (t / (c / a));
} else if (b <= 1.5e-200) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (b <= 7.2e+46) {
tmp = -4.0 * (a / (c / t));
} 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 (b <= (-540000000000.0d0)) then
tmp = (1.0d0 / z) / (c / b)
else if (b <= (-2.8d-216)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= (-1.45d-260)) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (b <= 4.25d-306) then
tmp = (-4.0d0) * (t / (c / a))
else if (b <= 1.5d-200) then
tmp = 9.0d0 * ((x * y) / (z * c))
else if (b <= 7.2d+46) then
tmp = (-4.0d0) * (a / (c / t))
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 (b <= -540000000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -2.8e-216) {
tmp = -4.0 * (t * (a / c));
} else if (b <= -1.45e-260) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 4.25e-306) {
tmp = -4.0 * (t / (c / a));
} else if (b <= 1.5e-200) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (b <= 7.2e+46) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -540000000000.0: tmp = (1.0 / z) / (c / b) elif b <= -2.8e-216: tmp = -4.0 * (t * (a / c)) elif b <= -1.45e-260: tmp = 9.0 * ((y / z) * (x / c)) elif b <= 4.25e-306: tmp = -4.0 * (t / (c / a)) elif b <= 1.5e-200: tmp = 9.0 * ((x * y) / (z * c)) elif b <= 7.2e+46: tmp = -4.0 * (a / (c / t)) 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 (b <= -540000000000.0) tmp = Float64(Float64(1.0 / z) / Float64(c / b)); elseif (b <= -2.8e-216) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= -1.45e-260) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (b <= 4.25e-306) tmp = Float64(-4.0 * Float64(t / Float64(c / a))); elseif (b <= 1.5e-200) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); elseif (b <= 7.2e+46) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 (b <= -540000000000.0)
tmp = (1.0 / z) / (c / b);
elseif (b <= -2.8e-216)
tmp = -4.0 * (t * (a / c));
elseif (b <= -1.45e-260)
tmp = 9.0 * ((y / z) * (x / c));
elseif (b <= 4.25e-306)
tmp = -4.0 * (t / (c / a));
elseif (b <= 1.5e-200)
tmp = 9.0 * ((x * y) / (z * c));
elseif (b <= 7.2e+46)
tmp = -4.0 * (a / (c / t));
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[b, -540000000000.0], N[(N[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.8e-216], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.45e-260], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.25e-306], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-200], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e+46], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -540000000000:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{c}{b}}\\
\mathbf{elif}\;b \leq -2.8 \cdot 10^{-216}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq -1.45 \cdot 10^{-260}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;b \leq 4.25 \cdot 10^{-306}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{-200}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{+46}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -5.4e11Initial program 82.8%
associate-+l-82.8%
div-sub74.6%
*-commutative74.6%
associate-*r*77.8%
*-commutative77.8%
div-sub86.0%
associate-+l-86.0%
Simplified84.5%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
frac-2neg67.6%
neg-mul-167.6%
metadata-eval67.6%
distribute-rgt-neg-in67.6%
times-frac70.3%
metadata-eval70.3%
Applied egg-rr70.3%
associate-*l/70.4%
associate-*r/70.4%
neg-mul-170.4%
Simplified70.4%
clear-num69.2%
frac-2neg69.2%
div-inv69.2%
metadata-eval69.2%
clear-num69.1%
associate-/l/67.5%
clear-num67.6%
div-inv67.6%
associate-*r*69.1%
div-inv69.1%
frac-2neg69.1%
Applied egg-rr69.1%
associate-*r/69.1%
metadata-eval69.1%
neg-mul-169.1%
associate-/r*69.1%
metadata-eval69.1%
associate-/r*70.4%
Simplified70.4%
if -5.4e11 < b < -2.8e-216Initial program 88.6%
associate-+l-88.6%
div-sub79.5%
*-commutative79.5%
associate-*r*75.2%
*-commutative75.2%
div-sub82.0%
associate-+l-82.0%
Simplified84.6%
Taylor expanded in z around inf 64.7%
associate-/l*66.6%
associate-/r/62.5%
Applied egg-rr62.5%
if -2.8e-216 < b < -1.45e-260Initial program 78.0%
associate-+l-78.0%
div-sub47.3%
*-commutative47.3%
associate-*r*47.3%
*-commutative47.3%
div-sub78.0%
associate-+l-78.0%
Simplified78.0%
Taylor expanded in x around inf 50.2%
times-frac57.3%
Simplified57.3%
if -1.45e-260 < b < 4.2500000000000001e-306Initial program 81.2%
associate-+l-81.2%
div-sub81.2%
*-commutative81.2%
associate-*r*81.2%
*-commutative81.2%
div-sub81.2%
associate-+l-81.2%
Simplified81.2%
Taylor expanded in z around inf 80.0%
*-commutative80.0%
*-commutative80.0%
associate-/l*80.0%
Simplified80.0%
if 4.2500000000000001e-306 < b < 1.49999999999999997e-200Initial program 92.1%
associate-+l-92.1%
div-sub92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
div-sub92.1%
associate-+l-92.1%
Simplified92.1%
Taylor expanded in x around inf 84.8%
if 1.49999999999999997e-200 < b < 7.1999999999999997e46Initial program 81.9%
associate-+l-81.9%
div-sub68.3%
*-commutative68.3%
associate-*r*66.1%
*-commutative66.1%
div-sub79.8%
associate-+l-79.8%
Simplified81.9%
Taylor expanded in z around inf 48.6%
*-commutative48.6%
associate-/l*52.9%
Simplified52.9%
if 7.1999999999999997e46 < b Initial program 71.0%
associate-+l-71.0%
div-sub64.7%
*-commutative64.7%
associate-*r*63.0%
*-commutative63.0%
div-sub69.4%
associate-+l-69.4%
Simplified71.1%
Taylor expanded in b around inf 51.2%
*-commutative51.2%
Simplified51.2%
frac-2neg51.2%
neg-mul-151.2%
metadata-eval51.2%
distribute-rgt-neg-in51.2%
times-frac64.2%
metadata-eval64.2%
Applied egg-rr64.2%
associate-*l/64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
div-inv64.2%
frac-2neg64.2%
frac-times51.2%
remove-double-neg51.2%
remove-double-neg51.2%
times-frac64.2%
associate-*l/59.5%
*-rgt-identity59.5%
*-commutative59.5%
times-frac51.2%
remove-double-neg51.2%
metadata-eval51.2%
metadata-eval51.2%
frac-2neg51.2%
div-inv51.2%
metadata-eval51.2%
metadata-eval51.2%
metadata-eval51.2%
*-commutative51.2%
metadata-eval51.2%
neg-mul-151.2%
remove-double-neg51.2%
Applied egg-rr51.2%
*-commutative51.2%
associate-/l/51.1%
un-div-inv51.2%
associate-/r*64.2%
Applied egg-rr64.2%
Final simplification65.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
(if (<= b -42000000000.0)
(/ (/ 1.0 z) (/ c b))
(if (<= b -6.5e-217)
(* -4.0 (* t (/ a c)))
(if (<= b -1.4e-260)
(* (/ x c) (/ (* 9.0 y) z))
(if (<= b 4.3e-302)
(* -4.0 (/ t (/ c a)))
(if (<= b 4.1e-196)
(* 9.0 (/ (* x y) (* z c)))
(if (<= b 2.65e+46) (* -4.0 (/ a (/ c t))) (/ (/ 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 (b <= -42000000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -6.5e-217) {
tmp = -4.0 * (t * (a / c));
} else if (b <= -1.4e-260) {
tmp = (x / c) * ((9.0 * y) / z);
} else if (b <= 4.3e-302) {
tmp = -4.0 * (t / (c / a));
} else if (b <= 4.1e-196) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (b <= 2.65e+46) {
tmp = -4.0 * (a / (c / t));
} 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 (b <= (-42000000000.0d0)) then
tmp = (1.0d0 / z) / (c / b)
else if (b <= (-6.5d-217)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= (-1.4d-260)) then
tmp = (x / c) * ((9.0d0 * y) / z)
else if (b <= 4.3d-302) then
tmp = (-4.0d0) * (t / (c / a))
else if (b <= 4.1d-196) then
tmp = 9.0d0 * ((x * y) / (z * c))
else if (b <= 2.65d+46) then
tmp = (-4.0d0) * (a / (c / t))
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 (b <= -42000000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -6.5e-217) {
tmp = -4.0 * (t * (a / c));
} else if (b <= -1.4e-260) {
tmp = (x / c) * ((9.0 * y) / z);
} else if (b <= 4.3e-302) {
tmp = -4.0 * (t / (c / a));
} else if (b <= 4.1e-196) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (b <= 2.65e+46) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -42000000000.0: tmp = (1.0 / z) / (c / b) elif b <= -6.5e-217: tmp = -4.0 * (t * (a / c)) elif b <= -1.4e-260: tmp = (x / c) * ((9.0 * y) / z) elif b <= 4.3e-302: tmp = -4.0 * (t / (c / a)) elif b <= 4.1e-196: tmp = 9.0 * ((x * y) / (z * c)) elif b <= 2.65e+46: tmp = -4.0 * (a / (c / t)) 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 (b <= -42000000000.0) tmp = Float64(Float64(1.0 / z) / Float64(c / b)); elseif (b <= -6.5e-217) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= -1.4e-260) tmp = Float64(Float64(x / c) * Float64(Float64(9.0 * y) / z)); elseif (b <= 4.3e-302) tmp = Float64(-4.0 * Float64(t / Float64(c / a))); elseif (b <= 4.1e-196) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); elseif (b <= 2.65e+46) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 (b <= -42000000000.0)
tmp = (1.0 / z) / (c / b);
elseif (b <= -6.5e-217)
tmp = -4.0 * (t * (a / c));
elseif (b <= -1.4e-260)
tmp = (x / c) * ((9.0 * y) / z);
elseif (b <= 4.3e-302)
tmp = -4.0 * (t / (c / a));
elseif (b <= 4.1e-196)
tmp = 9.0 * ((x * y) / (z * c));
elseif (b <= 2.65e+46)
tmp = -4.0 * (a / (c / t));
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[b, -42000000000.0], N[(N[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.5e-217], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.4e-260], N[(N[(x / c), $MachinePrecision] * N[(N[(9.0 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.3e-302], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.1e-196], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.65e+46], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -42000000000:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{c}{b}}\\
\mathbf{elif}\;b \leq -6.5 \cdot 10^{-217}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq -1.4 \cdot 10^{-260}:\\
\;\;\;\;\frac{x}{c} \cdot \frac{9 \cdot y}{z}\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{-302}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\mathbf{elif}\;b \leq 4.1 \cdot 10^{-196}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{+46}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -4.2e10Initial program 82.8%
associate-+l-82.8%
div-sub74.6%
*-commutative74.6%
associate-*r*77.8%
*-commutative77.8%
div-sub86.0%
associate-+l-86.0%
Simplified84.5%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
frac-2neg67.6%
neg-mul-167.6%
metadata-eval67.6%
distribute-rgt-neg-in67.6%
times-frac70.3%
metadata-eval70.3%
Applied egg-rr70.3%
associate-*l/70.4%
associate-*r/70.4%
neg-mul-170.4%
Simplified70.4%
clear-num69.2%
frac-2neg69.2%
div-inv69.2%
metadata-eval69.2%
clear-num69.1%
associate-/l/67.5%
clear-num67.6%
div-inv67.6%
associate-*r*69.1%
div-inv69.1%
frac-2neg69.1%
Applied egg-rr69.1%
associate-*r/69.1%
metadata-eval69.1%
neg-mul-169.1%
associate-/r*69.1%
metadata-eval69.1%
associate-/r*70.4%
Simplified70.4%
if -4.2e10 < b < -6.4999999999999996e-217Initial program 88.6%
associate-+l-88.6%
div-sub79.5%
*-commutative79.5%
associate-*r*75.2%
*-commutative75.2%
div-sub82.0%
associate-+l-82.0%
Simplified84.6%
Taylor expanded in z around inf 64.7%
associate-/l*66.6%
associate-/r/62.5%
Applied egg-rr62.5%
if -6.4999999999999996e-217 < b < -1.3999999999999999e-260Initial program 78.0%
associate-+l-78.0%
div-sub47.3%
*-commutative47.3%
associate-*r*47.3%
*-commutative47.3%
div-sub78.0%
associate-+l-78.0%
Simplified78.0%
Taylor expanded in x around inf 50.2%
*-commutative50.2%
associate-*r/50.2%
associate-*r*50.2%
*-commutative50.2%
associate-*r*50.2%
*-commutative50.2%
times-frac57.3%
Simplified57.3%
if -1.3999999999999999e-260 < b < 4.3000000000000002e-302Initial program 81.2%
associate-+l-81.2%
div-sub81.2%
*-commutative81.2%
associate-*r*81.2%
*-commutative81.2%
div-sub81.2%
associate-+l-81.2%
Simplified81.2%
Taylor expanded in z around inf 80.0%
*-commutative80.0%
*-commutative80.0%
associate-/l*80.0%
Simplified80.0%
if 4.3000000000000002e-302 < b < 4.10000000000000021e-196Initial program 92.1%
associate-+l-92.1%
div-sub92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
div-sub92.1%
associate-+l-92.1%
Simplified92.1%
Taylor expanded in x around inf 84.8%
if 4.10000000000000021e-196 < b < 2.64999999999999989e46Initial program 81.9%
associate-+l-81.9%
div-sub68.3%
*-commutative68.3%
associate-*r*66.1%
*-commutative66.1%
div-sub79.8%
associate-+l-79.8%
Simplified81.9%
Taylor expanded in z around inf 48.6%
*-commutative48.6%
associate-/l*52.9%
Simplified52.9%
if 2.64999999999999989e46 < b Initial program 71.0%
associate-+l-71.0%
div-sub64.7%
*-commutative64.7%
associate-*r*63.0%
*-commutative63.0%
div-sub69.4%
associate-+l-69.4%
Simplified71.1%
Taylor expanded in b around inf 51.2%
*-commutative51.2%
Simplified51.2%
frac-2neg51.2%
neg-mul-151.2%
metadata-eval51.2%
distribute-rgt-neg-in51.2%
times-frac64.2%
metadata-eval64.2%
Applied egg-rr64.2%
associate-*l/64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
div-inv64.2%
frac-2neg64.2%
frac-times51.2%
remove-double-neg51.2%
remove-double-neg51.2%
times-frac64.2%
associate-*l/59.5%
*-rgt-identity59.5%
*-commutative59.5%
times-frac51.2%
remove-double-neg51.2%
metadata-eval51.2%
metadata-eval51.2%
frac-2neg51.2%
div-inv51.2%
metadata-eval51.2%
metadata-eval51.2%
metadata-eval51.2%
*-commutative51.2%
metadata-eval51.2%
neg-mul-151.2%
remove-double-neg51.2%
Applied egg-rr51.2%
*-commutative51.2%
associate-/l/51.1%
un-div-inv51.2%
associate-/r*64.2%
Applied egg-rr64.2%
Final simplification65.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
(if (<= b -265000000.0)
(/ (/ 1.0 z) (/ c b))
(if (<= b -4.2e-218)
(* -4.0 (* t (/ a c)))
(if (<= b -7.5e-276)
(/ (* y (/ x c)) (* z 0.1111111111111111))
(if (<= b 5.2e-299)
(* -4.0 (/ t (/ c a)))
(if (<= b 1.45e-198)
(* 9.0 (/ (* x y) (* z c)))
(if (<= b 2.02e+46) (* -4.0 (/ a (/ c t))) (/ (/ 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 (b <= -265000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -4.2e-218) {
tmp = -4.0 * (t * (a / c));
} else if (b <= -7.5e-276) {
tmp = (y * (x / c)) / (z * 0.1111111111111111);
} else if (b <= 5.2e-299) {
tmp = -4.0 * (t / (c / a));
} else if (b <= 1.45e-198) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (b <= 2.02e+46) {
tmp = -4.0 * (a / (c / t));
} 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 (b <= (-265000000.0d0)) then
tmp = (1.0d0 / z) / (c / b)
else if (b <= (-4.2d-218)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= (-7.5d-276)) then
tmp = (y * (x / c)) / (z * 0.1111111111111111d0)
else if (b <= 5.2d-299) then
tmp = (-4.0d0) * (t / (c / a))
else if (b <= 1.45d-198) then
tmp = 9.0d0 * ((x * y) / (z * c))
else if (b <= 2.02d+46) then
tmp = (-4.0d0) * (a / (c / t))
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 (b <= -265000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -4.2e-218) {
tmp = -4.0 * (t * (a / c));
} else if (b <= -7.5e-276) {
tmp = (y * (x / c)) / (z * 0.1111111111111111);
} else if (b <= 5.2e-299) {
tmp = -4.0 * (t / (c / a));
} else if (b <= 1.45e-198) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (b <= 2.02e+46) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -265000000.0: tmp = (1.0 / z) / (c / b) elif b <= -4.2e-218: tmp = -4.0 * (t * (a / c)) elif b <= -7.5e-276: tmp = (y * (x / c)) / (z * 0.1111111111111111) elif b <= 5.2e-299: tmp = -4.0 * (t / (c / a)) elif b <= 1.45e-198: tmp = 9.0 * ((x * y) / (z * c)) elif b <= 2.02e+46: tmp = -4.0 * (a / (c / t)) 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 (b <= -265000000.0) tmp = Float64(Float64(1.0 / z) / Float64(c / b)); elseif (b <= -4.2e-218) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= -7.5e-276) tmp = Float64(Float64(y * Float64(x / c)) / Float64(z * 0.1111111111111111)); elseif (b <= 5.2e-299) tmp = Float64(-4.0 * Float64(t / Float64(c / a))); elseif (b <= 1.45e-198) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); elseif (b <= 2.02e+46) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 (b <= -265000000.0)
tmp = (1.0 / z) / (c / b);
elseif (b <= -4.2e-218)
tmp = -4.0 * (t * (a / c));
elseif (b <= -7.5e-276)
tmp = (y * (x / c)) / (z * 0.1111111111111111);
elseif (b <= 5.2e-299)
tmp = -4.0 * (t / (c / a));
elseif (b <= 1.45e-198)
tmp = 9.0 * ((x * y) / (z * c));
elseif (b <= 2.02e+46)
tmp = -4.0 * (a / (c / t));
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[b, -265000000.0], N[(N[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.2e-218], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7.5e-276], N[(N[(y * N[(x / c), $MachinePrecision]), $MachinePrecision] / N[(z * 0.1111111111111111), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-299], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.45e-198], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.02e+46], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -265000000:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{c}{b}}\\
\mathbf{elif}\;b \leq -4.2 \cdot 10^{-218}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq -7.5 \cdot 10^{-276}:\\
\;\;\;\;\frac{y \cdot \frac{x}{c}}{z \cdot 0.1111111111111111}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-299}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{-198}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{elif}\;b \leq 2.02 \cdot 10^{+46}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -2.65e8Initial program 82.8%
associate-+l-82.8%
div-sub74.6%
*-commutative74.6%
associate-*r*77.8%
*-commutative77.8%
div-sub86.0%
associate-+l-86.0%
Simplified84.5%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
frac-2neg67.6%
neg-mul-167.6%
metadata-eval67.6%
distribute-rgt-neg-in67.6%
times-frac70.3%
metadata-eval70.3%
Applied egg-rr70.3%
associate-*l/70.4%
associate-*r/70.4%
neg-mul-170.4%
Simplified70.4%
clear-num69.2%
frac-2neg69.2%
div-inv69.2%
metadata-eval69.2%
clear-num69.1%
associate-/l/67.5%
clear-num67.6%
div-inv67.6%
associate-*r*69.1%
div-inv69.1%
frac-2neg69.1%
Applied egg-rr69.1%
associate-*r/69.1%
metadata-eval69.1%
neg-mul-169.1%
associate-/r*69.1%
metadata-eval69.1%
associate-/r*70.4%
Simplified70.4%
if -2.65e8 < b < -4.19999999999999988e-218Initial program 88.6%
associate-+l-88.6%
div-sub79.5%
*-commutative79.5%
associate-*r*75.2%
*-commutative75.2%
div-sub82.0%
associate-+l-82.0%
Simplified84.6%
Taylor expanded in z around inf 64.7%
associate-/l*66.6%
associate-/r/62.5%
Applied egg-rr62.5%
if -4.19999999999999988e-218 < b < -7.500000000000001e-276Initial program 74.7%
associate-+l-74.7%
div-sub48.0%
*-commutative48.0%
associate-*r*48.0%
*-commutative48.0%
div-sub74.7%
associate-+l-74.7%
Simplified74.8%
Taylor expanded in x around inf 44.2%
times-frac50.3%
Simplified50.3%
associate-*r*50.3%
clear-num50.2%
un-div-inv50.3%
frac-times56.6%
*-commutative56.6%
Applied egg-rr56.6%
associate-/r*50.2%
associate-/r/44.4%
*-commutative44.4%
associate-/l*44.3%
div-inv44.3%
clear-num44.3%
Applied egg-rr44.3%
div-inv44.3%
associate-*l*50.3%
clear-num50.3%
un-div-inv50.3%
associate-*l/63.0%
associate-*l/63.0%
*-lft-identity63.0%
div-inv62.9%
metadata-eval62.9%
Applied egg-rr62.9%
if -7.500000000000001e-276 < b < 5.1999999999999998e-299Initial program 100.0%
associate-+l-100.0%
div-sub100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
div-sub100.0%
associate-+l-100.0%
Simplified99.5%
Taylor expanded in z around inf 99.5%
*-commutative99.5%
*-commutative99.5%
associate-/l*99.5%
Simplified99.5%
if 5.1999999999999998e-299 < b < 1.45e-198Initial program 92.1%
associate-+l-92.1%
div-sub92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
div-sub92.1%
associate-+l-92.1%
Simplified92.1%
Taylor expanded in x around inf 84.8%
if 1.45e-198 < b < 2.01999999999999994e46Initial program 81.9%
associate-+l-81.9%
div-sub68.3%
*-commutative68.3%
associate-*r*66.1%
*-commutative66.1%
div-sub79.8%
associate-+l-79.8%
Simplified81.9%
Taylor expanded in z around inf 48.6%
*-commutative48.6%
associate-/l*52.9%
Simplified52.9%
if 2.01999999999999994e46 < b Initial program 71.0%
associate-+l-71.0%
div-sub64.7%
*-commutative64.7%
associate-*r*63.0%
*-commutative63.0%
div-sub69.4%
associate-+l-69.4%
Simplified71.1%
Taylor expanded in b around inf 51.2%
*-commutative51.2%
Simplified51.2%
frac-2neg51.2%
neg-mul-151.2%
metadata-eval51.2%
distribute-rgt-neg-in51.2%
times-frac64.2%
metadata-eval64.2%
Applied egg-rr64.2%
associate-*l/64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
div-inv64.2%
frac-2neg64.2%
frac-times51.2%
remove-double-neg51.2%
remove-double-neg51.2%
times-frac64.2%
associate-*l/59.5%
*-rgt-identity59.5%
*-commutative59.5%
times-frac51.2%
remove-double-neg51.2%
metadata-eval51.2%
metadata-eval51.2%
frac-2neg51.2%
div-inv51.2%
metadata-eval51.2%
metadata-eval51.2%
metadata-eval51.2%
*-commutative51.2%
metadata-eval51.2%
neg-mul-151.2%
remove-double-neg51.2%
Applied egg-rr51.2%
*-commutative51.2%
associate-/l/51.1%
un-div-inv51.2%
associate-/r*64.2%
Applied egg-rr64.2%
Final simplification65.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
(let* ((t_1 (* -4.0 (* a t))))
(if (<= b -8200000000000.0)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (<= b 1.3e+96)
(/ (+ t_1 (* 9.0 (/ (* x y) z))) c)
(/ (+ t_1 (/ b z)) c)))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * t);
double tmp;
if (b <= -8200000000000.0) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (b <= 1.3e+96) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = (t_1 + (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) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
if (b <= (-8200000000000.0d0)) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else if (b <= 1.3d+96) then
tmp = (t_1 + (9.0d0 * ((x * y) / z))) / c
else
tmp = (t_1 + (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 t_1 = -4.0 * (a * t);
double tmp;
if (b <= -8200000000000.0) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (b <= 1.3e+96) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * t) tmp = 0 if b <= -8200000000000.0: tmp = (b + (9.0 * (x * y))) / (z * c) elif b <= 1.3e+96: tmp = (t_1 + (9.0 * ((x * y) / z))) / c else: tmp = (t_1 + (b / z)) / c return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (b <= -8200000000000.0) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif (b <= 1.3e+96) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(x * y) / z))) / c); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * t);
tmp = 0.0;
if (b <= -8200000000000.0)
tmp = (b + (9.0 * (x * y))) / (z * c);
elseif (b <= 1.3e+96)
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
else
tmp = (t_1 + (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_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8200000000000.0], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.3e+96], N[(N[(t$95$1 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;b \leq -8200000000000:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{+96}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -8.2e12Initial program 84.1%
associate-+l-84.1%
div-sub75.8%
*-commutative75.8%
associate-*r*79.1%
*-commutative79.1%
div-sub87.4%
associate-+l-87.4%
Simplified85.8%
Taylor expanded in x around inf 81.5%
if -8.2e12 < b < 1.3e96Initial program 85.3%
associate-+l-85.3%
div-sub75.3%
*-commutative75.3%
associate-*r*73.3%
*-commutative73.3%
div-sub82.5%
associate-+l-82.5%
Simplified84.0%
Applied egg-rr86.3%
Taylor expanded in x around 0 91.0%
Taylor expanded in b around 0 81.8%
if 1.3e96 < b Initial program 68.7%
associate-+l-68.7%
div-sub61.4%
*-commutative61.4%
associate-*r*59.5%
*-commutative59.5%
div-sub66.8%
associate-+l-66.8%
Simplified68.7%
Applied egg-rr77.5%
Taylor expanded in x around 0 82.3%
Taylor expanded in x around 0 82.4%
Final simplification81.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 (<= b -10500000000.0)
(/ (/ 1.0 z) (/ c b))
(if (<= b -3.6e-218)
(* -4.0 (* t (/ a c)))
(if (<= b 3.5e-194)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= b 3e+49) (* -4.0 (/ a (/ c t))) (/ (/ 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 (b <= -10500000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -3.6e-218) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 3.5e-194) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 3e+49) {
tmp = -4.0 * (a / (c / t));
} 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 (b <= (-10500000000.0d0)) then
tmp = (1.0d0 / z) / (c / b)
else if (b <= (-3.6d-218)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= 3.5d-194) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (b <= 3d+49) then
tmp = (-4.0d0) * (a / (c / t))
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 (b <= -10500000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= -3.6e-218) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 3.5e-194) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 3e+49) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -10500000000.0: tmp = (1.0 / z) / (c / b) elif b <= -3.6e-218: tmp = -4.0 * (t * (a / c)) elif b <= 3.5e-194: tmp = 9.0 * ((y / z) * (x / c)) elif b <= 3e+49: tmp = -4.0 * (a / (c / t)) 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 (b <= -10500000000.0) tmp = Float64(Float64(1.0 / z) / Float64(c / b)); elseif (b <= -3.6e-218) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= 3.5e-194) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (b <= 3e+49) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 (b <= -10500000000.0)
tmp = (1.0 / z) / (c / b);
elseif (b <= -3.6e-218)
tmp = -4.0 * (t * (a / c));
elseif (b <= 3.5e-194)
tmp = 9.0 * ((y / z) * (x / c));
elseif (b <= 3e+49)
tmp = -4.0 * (a / (c / t));
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[b, -10500000000.0], N[(N[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.6e-218], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.5e-194], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e+49], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -10500000000:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{c}{b}}\\
\mathbf{elif}\;b \leq -3.6 \cdot 10^{-218}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-194}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;b \leq 3 \cdot 10^{+49}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -1.05e10Initial program 82.8%
associate-+l-82.8%
div-sub74.6%
*-commutative74.6%
associate-*r*77.8%
*-commutative77.8%
div-sub86.0%
associate-+l-86.0%
Simplified84.5%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
frac-2neg67.6%
neg-mul-167.6%
metadata-eval67.6%
distribute-rgt-neg-in67.6%
times-frac70.3%
metadata-eval70.3%
Applied egg-rr70.3%
associate-*l/70.4%
associate-*r/70.4%
neg-mul-170.4%
Simplified70.4%
clear-num69.2%
frac-2neg69.2%
div-inv69.2%
metadata-eval69.2%
clear-num69.1%
associate-/l/67.5%
clear-num67.6%
div-inv67.6%
associate-*r*69.1%
div-inv69.1%
frac-2neg69.1%
Applied egg-rr69.1%
associate-*r/69.1%
metadata-eval69.1%
neg-mul-169.1%
associate-/r*69.1%
metadata-eval69.1%
associate-/r*70.4%
Simplified70.4%
if -1.05e10 < b < -3.60000000000000011e-218Initial program 88.6%
associate-+l-88.6%
div-sub79.5%
*-commutative79.5%
associate-*r*75.2%
*-commutative75.2%
div-sub82.0%
associate-+l-82.0%
Simplified84.6%
Taylor expanded in z around inf 64.7%
associate-/l*66.6%
associate-/r/62.5%
Applied egg-rr62.5%
if -3.60000000000000011e-218 < b < 3.5000000000000003e-194Initial program 86.7%
associate-+l-86.7%
div-sub77.6%
*-commutative77.6%
associate-*r*77.6%
*-commutative77.6%
div-sub86.7%
associate-+l-86.7%
Simplified86.7%
Taylor expanded in x around inf 67.6%
times-frac58.7%
Simplified58.7%
if 3.5000000000000003e-194 < b < 3.0000000000000002e49Initial program 81.9%
associate-+l-81.9%
div-sub68.3%
*-commutative68.3%
associate-*r*66.1%
*-commutative66.1%
div-sub79.8%
associate-+l-79.8%
Simplified81.9%
Taylor expanded in z around inf 48.6%
*-commutative48.6%
associate-/l*52.9%
Simplified52.9%
if 3.0000000000000002e49 < b Initial program 71.0%
associate-+l-71.0%
div-sub64.7%
*-commutative64.7%
associate-*r*63.0%
*-commutative63.0%
div-sub69.4%
associate-+l-69.4%
Simplified71.1%
Taylor expanded in b around inf 51.2%
*-commutative51.2%
Simplified51.2%
frac-2neg51.2%
neg-mul-151.2%
metadata-eval51.2%
distribute-rgt-neg-in51.2%
times-frac64.2%
metadata-eval64.2%
Applied egg-rr64.2%
associate-*l/64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
div-inv64.2%
frac-2neg64.2%
frac-times51.2%
remove-double-neg51.2%
remove-double-neg51.2%
times-frac64.2%
associate-*l/59.5%
*-rgt-identity59.5%
*-commutative59.5%
times-frac51.2%
remove-double-neg51.2%
metadata-eval51.2%
metadata-eval51.2%
frac-2neg51.2%
div-inv51.2%
metadata-eval51.2%
metadata-eval51.2%
metadata-eval51.2%
*-commutative51.2%
metadata-eval51.2%
neg-mul-151.2%
remove-double-neg51.2%
Applied egg-rr51.2%
*-commutative51.2%
associate-/l/51.1%
un-div-inv51.2%
associate-/r*64.2%
Applied egg-rr64.2%
Final simplification62.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
(if (<= y -0.00072)
(/ (* 9.0 y) (* z (/ c x)))
(if (<= y 2e+195)
(/ (+ (* -4.0 (* a t)) (/ b z)) c)
(/ (* x (* 9.0 (/ y z))) c))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -0.00072) {
tmp = (9.0 * y) / (z * (c / x));
} else if (y <= 2e+195) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (x * (9.0 * (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) :: tmp
if (y <= (-0.00072d0)) then
tmp = (9.0d0 * y) / (z * (c / x))
else if (y <= 2d+195) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c
else
tmp = (x * (9.0d0 * (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 tmp;
if (y <= -0.00072) {
tmp = (9.0 * y) / (z * (c / x));
} else if (y <= 2e+195) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (x * (9.0 * (y / z))) / c;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if y <= -0.00072: tmp = (9.0 * y) / (z * (c / x)) elif y <= 2e+195: tmp = ((-4.0 * (a * t)) + (b / z)) / c else: tmp = (x * (9.0 * (y / z))) / c return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -0.00072) tmp = Float64(Float64(9.0 * y) / Float64(z * Float64(c / x))); elseif (y <= 2e+195) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); else tmp = Float64(Float64(x * Float64(9.0 * Float64(y / 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 (y <= -0.00072)
tmp = (9.0 * y) / (z * (c / x));
elseif (y <= 2e+195)
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
else
tmp = (x * (9.0 * (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_] := If[LessEqual[y, -0.00072], N[(N[(9.0 * y), $MachinePrecision] / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+195], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(x * N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00072:\\
\;\;\;\;\frac{9 \cdot y}{z \cdot \frac{c}{x}}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+195}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot \frac{y}{z}\right)}{c}\\
\end{array}
\end{array}
if y < -7.20000000000000045e-4Initial program 77.8%
associate-+l-77.8%
div-sub67.3%
*-commutative67.3%
associate-*r*68.9%
*-commutative68.9%
div-sub79.5%
associate-+l-79.5%
Simplified78.1%
Taylor expanded in x around inf 52.4%
times-frac54.8%
Simplified54.8%
associate-*r*54.8%
clear-num54.8%
un-div-inv54.8%
frac-times59.0%
*-commutative59.0%
Applied egg-rr59.0%
if -7.20000000000000045e-4 < y < 1.99999999999999995e195Initial program 82.2%
associate-+l-82.2%
div-sub73.8%
*-commutative73.8%
associate-*r*72.2%
*-commutative72.2%
div-sub80.0%
associate-+l-80.0%
Simplified81.7%
Applied egg-rr84.0%
Taylor expanded in x around 0 89.2%
Taylor expanded in x around 0 74.2%
if 1.99999999999999995e195 < y Initial program 84.8%
associate-+l-84.8%
div-sub74.8%
*-commutative74.8%
associate-*r*74.8%
*-commutative74.8%
div-sub84.8%
associate-+l-84.8%
Simplified84.8%
Taylor expanded in x around inf 75.2%
times-frac65.7%
Simplified65.7%
*-commutative65.7%
associate-*l*65.8%
associate-*l/70.6%
*-commutative70.6%
Applied egg-rr70.6%
Final simplification70.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 (if (<= t -7.2e+77) (/ (+ (* -4.0 (* a t)) (/ b z)) c) (if (<= t 1e+95) (/ (+ b (* 9.0 (* x y))) (* 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 (t <= -7.2e+77) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else if (t <= 1e+95) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -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 (t <= (-7.2d+77)) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c
else if (t <= 1d+95) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (-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 (t <= -7.2e+77) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else if (t <= 1e+95) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -7.2e+77: tmp = ((-4.0 * (a * t)) + (b / z)) / c elif t <= 1e+95: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = -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 (t <= -7.2e+77) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); elseif (t <= 1e+95) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t * Float64(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 (t <= -7.2e+77)
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
elseif (t <= 1e+95)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = -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[t, -7.2e+77], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t, 1e+95], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+77}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;t \leq 10^{+95}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if t < -7.1999999999999996e77Initial program 67.9%
associate-+l-67.9%
div-sub55.6%
*-commutative55.6%
associate-*r*57.7%
*-commutative57.7%
div-sub70.0%
associate-+l-70.0%
Simplified66.5%
Applied egg-rr74.8%
Taylor expanded in x around 0 86.6%
Taylor expanded in x around 0 72.0%
if -7.1999999999999996e77 < t < 1.00000000000000002e95Initial program 84.9%
associate-+l-84.9%
div-sub77.3%
*-commutative77.3%
associate-*r*74.5%
*-commutative74.5%
div-sub81.5%
associate-+l-81.5%
Simplified84.8%
Taylor expanded in x around inf 72.3%
if 1.00000000000000002e95 < t Initial program 83.2%
associate-+l-83.2%
div-sub71.8%
*-commutative71.8%
associate-*r*77.4%
*-commutative77.4%
div-sub88.9%
associate-+l-88.9%
Simplified83.5%
Taylor expanded in z around inf 52.8%
associate-/l*63.4%
associate-/r/63.3%
Applied egg-rr63.3%
Final simplification71.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 (if (or (<= b -2400000000000.0) (not (<= b 1.45e+48))) (/ (/ b c) z) (* -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 ((b <= -2400000000000.0) || !(b <= 1.45e+48)) {
tmp = (b / c) / z;
} else {
tmp = -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 ((b <= (-2400000000000.0d0)) .or. (.not. (b <= 1.45d+48))) then
tmp = (b / c) / z
else
tmp = (-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 ((b <= -2400000000000.0) || !(b <= 1.45e+48)) {
tmp = (b / c) / z;
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -2400000000000.0) or not (b <= 1.45e+48): tmp = (b / c) / z else: tmp = -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 ((b <= -2400000000000.0) || !(b <= 1.45e+48)) tmp = Float64(Float64(b / c) / z); else tmp = Float64(-4.0 * Float64(t * Float64(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 ((b <= -2400000000000.0) || ~((b <= 1.45e+48)))
tmp = (b / c) / z;
else
tmp = -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[Or[LessEqual[b, -2400000000000.0], N[Not[LessEqual[b, 1.45e+48]], $MachinePrecision]], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2400000000000 \lor \neg \left(b \leq 1.45 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if b < -2.4e12 or 1.4499999999999999e48 < b Initial program 77.4%
associate-+l-77.4%
div-sub70.1%
*-commutative70.1%
associate-*r*70.9%
*-commutative70.9%
div-sub78.2%
associate-+l-78.2%
Simplified78.3%
Taylor expanded in b around inf 59.7%
*-commutative59.7%
Simplified59.7%
frac-2neg59.7%
neg-mul-159.7%
metadata-eval59.7%
distribute-rgt-neg-in59.7%
times-frac67.7%
metadata-eval67.7%
Applied egg-rr67.7%
associate-*l/67.8%
associate-*r/67.8%
neg-mul-167.8%
Simplified67.8%
div-inv67.7%
frac-2neg67.7%
frac-times59.7%
remove-double-neg59.7%
remove-double-neg59.7%
times-frac67.7%
associate-*l/60.8%
*-rgt-identity60.8%
*-commutative60.8%
times-frac59.7%
remove-double-neg59.7%
metadata-eval59.7%
metadata-eval59.7%
frac-2neg59.7%
div-inv59.7%
metadata-eval59.7%
metadata-eval59.7%
metadata-eval59.7%
*-commutative59.7%
metadata-eval59.7%
neg-mul-159.7%
remove-double-neg59.7%
Applied egg-rr59.7%
*-commutative59.7%
associate-/l/59.7%
un-div-inv59.7%
associate-/r*67.8%
Applied egg-rr67.8%
if -2.4e12 < b < 1.4499999999999999e48Initial program 85.1%
associate-+l-85.1%
div-sub74.6%
*-commutative74.6%
associate-*r*72.5%
*-commutative72.5%
div-sub82.3%
associate-+l-82.3%
Simplified83.8%
Taylor expanded in z around inf 47.2%
associate-/l*50.0%
associate-/r/46.4%
Applied egg-rr46.4%
Final simplification56.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 (<= b -1200000000000.0) (not (<= b 2.25e+46))) (/ (/ b c) z) (* -4.0 (/ t (/ c a)))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -1200000000000.0) || !(b <= 2.25e+46)) {
tmp = (b / c) / z;
} else {
tmp = -4.0 * (t / (c / a));
}
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 ((b <= (-1200000000000.0d0)) .or. (.not. (b <= 2.25d+46))) then
tmp = (b / c) / z
else
tmp = (-4.0d0) * (t / (c / a))
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 ((b <= -1200000000000.0) || !(b <= 2.25e+46)) {
tmp = (b / c) / z;
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -1200000000000.0) or not (b <= 2.25e+46): tmp = (b / c) / z else: tmp = -4.0 * (t / (c / a)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -1200000000000.0) || !(b <= 2.25e+46)) tmp = Float64(Float64(b / c) / z); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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 ((b <= -1200000000000.0) || ~((b <= 2.25e+46)))
tmp = (b / c) / z;
else
tmp = -4.0 * (t / (c / a));
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[b, -1200000000000.0], N[Not[LessEqual[b, 2.25e+46]], $MachinePrecision]], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1200000000000 \lor \neg \left(b \leq 2.25 \cdot 10^{+46}\right):\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if b < -1.2e12 or 2.25000000000000005e46 < b Initial program 77.4%
associate-+l-77.4%
div-sub70.1%
*-commutative70.1%
associate-*r*70.9%
*-commutative70.9%
div-sub78.2%
associate-+l-78.2%
Simplified78.3%
Taylor expanded in b around inf 59.7%
*-commutative59.7%
Simplified59.7%
frac-2neg59.7%
neg-mul-159.7%
metadata-eval59.7%
distribute-rgt-neg-in59.7%
times-frac67.7%
metadata-eval67.7%
Applied egg-rr67.7%
associate-*l/67.8%
associate-*r/67.8%
neg-mul-167.8%
Simplified67.8%
div-inv67.7%
frac-2neg67.7%
frac-times59.7%
remove-double-neg59.7%
remove-double-neg59.7%
times-frac67.7%
associate-*l/60.8%
*-rgt-identity60.8%
*-commutative60.8%
times-frac59.7%
remove-double-neg59.7%
metadata-eval59.7%
metadata-eval59.7%
frac-2neg59.7%
div-inv59.7%
metadata-eval59.7%
metadata-eval59.7%
metadata-eval59.7%
*-commutative59.7%
metadata-eval59.7%
neg-mul-159.7%
remove-double-neg59.7%
Applied egg-rr59.7%
*-commutative59.7%
associate-/l/59.7%
un-div-inv59.7%
associate-/r*67.8%
Applied egg-rr67.8%
if -1.2e12 < b < 2.25000000000000005e46Initial program 85.1%
associate-+l-85.1%
div-sub74.6%
*-commutative74.6%
associate-*r*72.5%
*-commutative72.5%
div-sub82.3%
associate-+l-82.3%
Simplified83.8%
Taylor expanded in z around inf 47.2%
*-commutative47.2%
*-commutative47.2%
associate-/l*47.1%
Simplified47.1%
Final simplification57.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 (if (<= b -5200000000000.0) (/ (/ 1.0 z) (/ c b)) (if (<= b 4.1e+47) (* -4.0 (/ t (/ c a))) (/ (/ 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 (b <= -5200000000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= 4.1e+47) {
tmp = -4.0 * (t / (c / a));
} 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 (b <= (-5200000000000.0d0)) then
tmp = (1.0d0 / z) / (c / b)
else if (b <= 4.1d+47) then
tmp = (-4.0d0) * (t / (c / a))
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 (b <= -5200000000000.0) {
tmp = (1.0 / z) / (c / b);
} else if (b <= 4.1e+47) {
tmp = -4.0 * (t / (c / a));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -5200000000000.0: tmp = (1.0 / z) / (c / b) elif b <= 4.1e+47: tmp = -4.0 * (t / (c / a)) 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 (b <= -5200000000000.0) tmp = Float64(Float64(1.0 / z) / Float64(c / b)); elseif (b <= 4.1e+47) tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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 (b <= -5200000000000.0)
tmp = (1.0 / z) / (c / b);
elseif (b <= 4.1e+47)
tmp = -4.0 * (t / (c / a));
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[b, -5200000000000.0], N[(N[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.1e+47], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5200000000000:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{c}{b}}\\
\mathbf{elif}\;b \leq 4.1 \cdot 10^{+47}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -5.2e12Initial program 84.1%
associate-+l-84.1%
div-sub75.8%
*-commutative75.8%
associate-*r*79.1%
*-commutative79.1%
div-sub87.4%
associate-+l-87.4%
Simplified85.8%
Taylor expanded in b around inf 68.6%
*-commutative68.6%
Simplified68.6%
frac-2neg68.6%
neg-mul-168.6%
metadata-eval68.6%
distribute-rgt-neg-in68.6%
times-frac71.4%
metadata-eval71.4%
Applied egg-rr71.4%
associate-*l/71.5%
associate-*r/71.5%
neg-mul-171.5%
Simplified71.5%
clear-num70.2%
frac-2neg70.2%
div-inv70.2%
metadata-eval70.2%
clear-num70.2%
associate-/l/68.6%
clear-num68.6%
div-inv68.6%
associate-*r*70.2%
div-inv70.2%
frac-2neg70.2%
Applied egg-rr70.2%
associate-*r/70.2%
metadata-eval70.2%
neg-mul-170.2%
associate-/r*70.2%
metadata-eval70.2%
associate-/r*71.5%
Simplified71.5%
if -5.2e12 < b < 4.1000000000000001e47Initial program 85.1%
associate-+l-85.1%
div-sub74.6%
*-commutative74.6%
associate-*r*72.5%
*-commutative72.5%
div-sub82.3%
associate-+l-82.3%
Simplified83.8%
Taylor expanded in z around inf 47.2%
*-commutative47.2%
*-commutative47.2%
associate-/l*47.1%
Simplified47.1%
if 4.1000000000000001e47 < b Initial program 71.0%
associate-+l-71.0%
div-sub64.7%
*-commutative64.7%
associate-*r*63.0%
*-commutative63.0%
div-sub69.4%
associate-+l-69.4%
Simplified71.1%
Taylor expanded in b around inf 51.2%
*-commutative51.2%
Simplified51.2%
frac-2neg51.2%
neg-mul-151.2%
metadata-eval51.2%
distribute-rgt-neg-in51.2%
times-frac64.2%
metadata-eval64.2%
Applied egg-rr64.2%
associate-*l/64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
div-inv64.2%
frac-2neg64.2%
frac-times51.2%
remove-double-neg51.2%
remove-double-neg51.2%
times-frac64.2%
associate-*l/59.5%
*-rgt-identity59.5%
*-commutative59.5%
times-frac51.2%
remove-double-neg51.2%
metadata-eval51.2%
metadata-eval51.2%
frac-2neg51.2%
div-inv51.2%
metadata-eval51.2%
metadata-eval51.2%
metadata-eval51.2%
*-commutative51.2%
metadata-eval51.2%
neg-mul-151.2%
remove-double-neg51.2%
Applied egg-rr51.2%
*-commutative51.2%
associate-/l/51.1%
un-div-inv51.2%
associate-/r*64.2%
Applied egg-rr64.2%
Final simplification57.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 81.4%
associate-+l-81.4%
div-sub72.4%
*-commutative72.4%
associate-*r*71.7%
*-commutative71.7%
div-sub80.3%
associate-+l-80.3%
Simplified81.1%
Taylor expanded in b around inf 38.0%
*-commutative38.0%
Simplified38.0%
Final simplification38.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 c) z))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (b / c) / z
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return (b / c) / z
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(Float64(b / c) / z) end
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = (b / c) / z;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{\frac{b}{c}}{z}
\end{array}
Initial program 81.4%
associate-+l-81.4%
div-sub72.4%
*-commutative72.4%
associate-*r*71.7%
*-commutative71.7%
div-sub80.3%
associate-+l-80.3%
Simplified81.1%
Taylor expanded in b around inf 38.0%
*-commutative38.0%
Simplified38.0%
frac-2neg38.0%
neg-mul-138.0%
metadata-eval38.0%
distribute-rgt-neg-in38.0%
times-frac40.4%
metadata-eval40.4%
Applied egg-rr40.4%
associate-*l/40.5%
associate-*r/40.5%
neg-mul-140.5%
Simplified40.5%
div-inv40.4%
frac-2neg40.4%
frac-times38.0%
remove-double-neg38.0%
remove-double-neg38.0%
times-frac40.4%
associate-*l/38.1%
*-rgt-identity38.1%
*-commutative38.1%
times-frac38.0%
remove-double-neg38.0%
metadata-eval38.0%
metadata-eval38.0%
frac-2neg38.0%
div-inv38.0%
metadata-eval38.0%
metadata-eval38.0%
metadata-eval38.0%
*-commutative38.0%
metadata-eval38.0%
neg-mul-138.0%
remove-double-neg38.0%
Applied egg-rr38.0%
*-commutative38.0%
associate-/l/38.0%
un-div-inv38.0%
associate-/r*40.5%
Applied egg-rr40.5%
Final simplification40.5%
(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 2023297
(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)))