
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* a -4.0))) (t_2 (/ (+ t_1 (* 9.0 (/ y (/ z x)))) c)))
(if (<= z -1.46e+156)
t_2
(if (<= z -5.2e+98)
(/ (+ t_1 (/ b z)) c)
(if (or (<= z -9.8e+72) (not (<= z 1.95e+159)))
t_2
(/ (+ b (- (* (* x 9.0) y) (* a (* t (* z 4.0))))) (* z c)))))))assert(x < y);
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 = (t_1 + (9.0 * (y / (z / x)))) / c;
double tmp;
if (z <= -1.46e+156) {
tmp = t_2;
} else if (z <= -5.2e+98) {
tmp = (t_1 + (b / z)) / c;
} else if ((z <= -9.8e+72) || !(z <= 1.95e+159)) {
tmp = t_2;
} else {
tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
NOTE: x and y 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 = t * (a * (-4.0d0))
t_2 = (t_1 + (9.0d0 * (y / (z / x)))) / c
if (z <= (-1.46d+156)) then
tmp = t_2
else if (z <= (-5.2d+98)) then
tmp = (t_1 + (b / z)) / c
else if ((z <= (-9.8d+72)) .or. (.not. (z <= 1.95d+159))) then
tmp = t_2
else
tmp = (b + (((x * 9.0d0) * y) - (a * (t * (z * 4.0d0))))) / (z * c)
end if
code = tmp
end function
assert x < y;
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 t_2 = (t_1 + (9.0 * (y / (z / x)))) / c;
double tmp;
if (z <= -1.46e+156) {
tmp = t_2;
} else if (z <= -5.2e+98) {
tmp = (t_1 + (b / z)) / c;
} else if ((z <= -9.8e+72) || !(z <= 1.95e+159)) {
tmp = t_2;
} else {
tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) t_2 = (t_1 + (9.0 * (y / (z / x)))) / c tmp = 0 if z <= -1.46e+156: tmp = t_2 elif z <= -5.2e+98: tmp = (t_1 + (b / z)) / c elif (z <= -9.8e+72) or not (z <= 1.95e+159): tmp = t_2 else: tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (z * c) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c) tmp = 0.0 if (z <= -1.46e+156) tmp = t_2; elseif (z <= -5.2e+98) tmp = Float64(Float64(t_1 + Float64(b / z)) / c); elseif ((z <= -9.8e+72) || !(z <= 1.95e+159)) tmp = t_2; else tmp = Float64(Float64(b + Float64(Float64(Float64(x * 9.0) * y) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (a * -4.0);
t_2 = (t_1 + (9.0 * (y / (z / x)))) / c;
tmp = 0.0;
if (z <= -1.46e+156)
tmp = t_2;
elseif (z <= -5.2e+98)
tmp = (t_1 + (b / z)) / c;
elseif ((z <= -9.8e+72) || ~((z <= 1.95e+159)))
tmp = t_2;
else
tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x and y 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[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.46e+156], t$95$2, If[LessEqual[z, -5.2e+98], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[Or[LessEqual[z, -9.8e+72], N[Not[LessEqual[z, 1.95e+159]], $MachinePrecision]], t$95$2, N[(N[(b + N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := \frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{if}\;z \leq -1.46 \cdot 10^{+156}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{+98}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{+72} \lor \neg \left(z \leq 1.95 \cdot 10^{+159}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(\left(x \cdot 9\right) \cdot y - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.46000000000000007e156 or -5.1999999999999999e98 < z < -9.80000000000000012e72 or 1.95e159 < z Initial program 49.9%
associate-/r*59.7%
Simplified85.5%
Taylor expanded in x around inf 82.4%
associate-/l*93.5%
Simplified93.5%
if -1.46000000000000007e156 < z < -5.1999999999999999e98Initial program 60.0%
associate-/r*75.8%
Simplified91.8%
Taylor expanded in x around 0 83.2%
if -9.80000000000000012e72 < z < 1.95e159Initial program 93.2%
Final simplification92.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= (* (* x 9.0) y) 1e+233) (/ (fma t (* a -4.0) (/ (fma x (* 9.0 y) b) z)) c) (* 9.0 (* (/ y z) (/ x c)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * 9.0) * y) <= 1e+233) {
tmp = fma(t, (a * -4.0), (fma(x, (9.0 * y), b) / z)) / c;
} else {
tmp = 9.0 * ((y / z) * (x / c));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(x * 9.0) * y) <= 1e+233) tmp = Float64(fma(t, Float64(a * -4.0), Float64(fma(x, Float64(9.0 * y), b) / z)) / c); else tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision], 1e+233], N[(N[(t * N[(a * -4.0), $MachinePrecision] + N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot 9\right) \cdot y \leq 10^{+233}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < 9.99999999999999974e232Initial program 85.2%
associate-/r*84.0%
Simplified92.9%
if 9.99999999999999974e232 < (*.f64 (*.f64 x 9) y) Initial program 51.7%
associate-/r*51.8%
Simplified55.5%
Taylor expanded in x around inf 51.8%
*-commutative51.8%
times-frac78.8%
Simplified78.8%
Final simplification91.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= (* (* x 9.0) y) 1e+233) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c) (* 9.0 (* (/ y z) (/ x c)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * 9.0) * y) <= 1e+233) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
} else {
tmp = 9.0 * ((y / z) * (x / c));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(x * 9.0) * y) <= 1e+233) tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(a * -4.0))) / c); else tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision], 1e+233], 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[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot 9\right) \cdot y \leq 10^{+233}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < 9.99999999999999974e232Initial program 85.2%
associate-/r*84.0%
Simplified92.4%
if 9.99999999999999974e232 < (*.f64 (*.f64 x 9) y) Initial program 51.7%
associate-/r*51.8%
Simplified55.5%
Taylor expanded in x around inf 51.8%
*-commutative51.8%
times-frac78.8%
Simplified78.8%
Final simplification90.9%
NOTE: x and y 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 (/ (+ t_1 (* 9.0 (/ y (/ z x)))) c)))
(if (<= z -1.62e+156)
t_2
(if (<= z -2.35e+98)
(/ (+ t_1 (/ b z)) c)
(if (or (<= z -6.7e+72) (not (<= z 3.5e+158)))
t_2
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c)))))))assert(x < y);
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 = (t_1 + (9.0 * (y / (z / x)))) / c;
double tmp;
if (z <= -1.62e+156) {
tmp = t_2;
} else if (z <= -2.35e+98) {
tmp = (t_1 + (b / z)) / c;
} else if ((z <= -6.7e+72) || !(z <= 3.5e+158)) {
tmp = t_2;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
}
return tmp;
}
NOTE: x and y 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 = t * (a * (-4.0d0))
t_2 = (t_1 + (9.0d0 * (y / (z / x)))) / c
if (z <= (-1.62d+156)) then
tmp = t_2
else if (z <= (-2.35d+98)) then
tmp = (t_1 + (b / z)) / c
else if ((z <= (-6.7d+72)) .or. (.not. (z <= 3.5d+158))) then
tmp = t_2
else
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (z * c)
end if
code = tmp
end function
assert x < y;
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 t_2 = (t_1 + (9.0 * (y / (z / x)))) / c;
double tmp;
if (z <= -1.62e+156) {
tmp = t_2;
} else if (z <= -2.35e+98) {
tmp = (t_1 + (b / z)) / c;
} else if ((z <= -6.7e+72) || !(z <= 3.5e+158)) {
tmp = t_2;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) t_2 = (t_1 + (9.0 * (y / (z / x)))) / c tmp = 0 if z <= -1.62e+156: tmp = t_2 elif z <= -2.35e+98: tmp = (t_1 + (b / z)) / c elif (z <= -6.7e+72) or not (z <= 3.5e+158): tmp = t_2 else: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c) tmp = 0.0 if (z <= -1.62e+156) tmp = t_2; elseif (z <= -2.35e+98) tmp = Float64(Float64(t_1 + Float64(b / z)) / c); elseif ((z <= -6.7e+72) || !(z <= 3.5e+158)) tmp = t_2; 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
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (a * -4.0);
t_2 = (t_1 + (9.0 * (y / (z / x)))) / c;
tmp = 0.0;
if (z <= -1.62e+156)
tmp = t_2;
elseif (z <= -2.35e+98)
tmp = (t_1 + (b / z)) / c;
elseif ((z <= -6.7e+72) || ~((z <= 3.5e+158)))
tmp = t_2;
else
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x and y 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[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.62e+156], t$95$2, If[LessEqual[z, -2.35e+98], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[Or[LessEqual[z, -6.7e+72], N[Not[LessEqual[z, 3.5e+158]], $MachinePrecision]], t$95$2, 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}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := \frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{if}\;z \leq -1.62 \cdot 10^{+156}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{+98}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq -6.7 \cdot 10^{+72} \lor \neg \left(z \leq 3.5 \cdot 10^{+158}\right):\\
\;\;\;\;t_2\\
\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 < -1.62000000000000006e156 or -2.34999999999999985e98 < z < -6.6999999999999998e72 or 3.5000000000000001e158 < z Initial program 49.9%
associate-/r*59.7%
Simplified85.5%
Taylor expanded in x around inf 82.4%
associate-/l*93.5%
Simplified93.5%
if -1.62000000000000006e156 < z < -2.34999999999999985e98Initial program 60.0%
associate-/r*75.8%
Simplified91.8%
Taylor expanded in x around 0 83.2%
if -6.6999999999999998e72 < z < 3.5000000000000001e158Initial program 93.2%
associate-*l*93.2%
associate-*l*91.7%
Simplified91.7%
Final simplification91.7%
NOTE: x and y 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)) (/ b z)) c))
(t_2 (/ (+ b (* 9.0 (* x y))) (* z c))))
(if (<= y -8.2e-108)
t_2
(if (<= y 7.8e+105)
t_1
(if (<= y 1.04e+201)
t_2
(if (<= y 1e+208) t_1 (/ (+ (* 9.0 (/ y (/ z x))) (/ b z)) c)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((t * (a * -4.0)) + (b / z)) / c;
double t_2 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (y <= -8.2e-108) {
tmp = t_2;
} else if (y <= 7.8e+105) {
tmp = t_1;
} else if (y <= 1.04e+201) {
tmp = t_2;
} else if (y <= 1e+208) {
tmp = t_1;
} else {
tmp = ((9.0 * (y / (z / x))) + (b / z)) / c;
}
return tmp;
}
NOTE: x and y 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 = ((t * (a * (-4.0d0))) + (b / z)) / c
t_2 = (b + (9.0d0 * (x * y))) / (z * c)
if (y <= (-8.2d-108)) then
tmp = t_2
else if (y <= 7.8d+105) then
tmp = t_1
else if (y <= 1.04d+201) then
tmp = t_2
else if (y <= 1d+208) then
tmp = t_1
else
tmp = ((9.0d0 * (y / (z / x))) + (b / z)) / c
end if
code = tmp
end function
assert x < y;
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)) + (b / z)) / c;
double t_2 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (y <= -8.2e-108) {
tmp = t_2;
} else if (y <= 7.8e+105) {
tmp = t_1;
} else if (y <= 1.04e+201) {
tmp = t_2;
} else if (y <= 1e+208) {
tmp = t_1;
} else {
tmp = ((9.0 * (y / (z / x))) + (b / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = ((t * (a * -4.0)) + (b / z)) / c t_2 = (b + (9.0 * (x * y))) / (z * c) tmp = 0 if y <= -8.2e-108: tmp = t_2 elif y <= 7.8e+105: tmp = t_1 elif y <= 1.04e+201: tmp = t_2 elif y <= 1e+208: tmp = t_1 else: tmp = ((9.0 * (y / (z / x))) + (b / z)) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c) t_2 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) tmp = 0.0 if (y <= -8.2e-108) tmp = t_2; elseif (y <= 7.8e+105) tmp = t_1; elseif (y <= 1.04e+201) tmp = t_2; elseif (y <= 1e+208) tmp = t_1; else tmp = Float64(Float64(Float64(9.0 * Float64(y / Float64(z / x))) + Float64(b / z)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = ((t * (a * -4.0)) + (b / z)) / c;
t_2 = (b + (9.0 * (x * y))) / (z * c);
tmp = 0.0;
if (y <= -8.2e-108)
tmp = t_2;
elseif (y <= 7.8e+105)
tmp = t_1;
elseif (y <= 1.04e+201)
tmp = t_2;
elseif (y <= 1e+208)
tmp = t_1;
else
tmp = ((9.0 * (y / (z / x))) + (b / z)) / c;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.2e-108], t$95$2, If[LessEqual[y, 7.8e+105], t$95$1, If[LessEqual[y, 1.04e+201], t$95$2, If[LessEqual[y, 1e+208], t$95$1, N[(N[(N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
t_2 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{-108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.04 \cdot 10^{+201}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 10^{+208}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{9 \cdot \frac{y}{\frac{z}{x}} + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if y < -8.20000000000000074e-108 or 7.79999999999999957e105 < y < 1.0400000000000001e201Initial program 78.4%
associate-/r*72.4%
Simplified82.1%
Taylor expanded in z around 0 61.3%
if -8.20000000000000074e-108 < y < 7.79999999999999957e105 or 1.0400000000000001e201 < y < 9.9999999999999998e207Initial program 84.0%
associate-/r*84.0%
Simplified93.5%
Taylor expanded in x around 0 83.0%
if 9.9999999999999998e207 < y Initial program 79.9%
associate-/r*88.5%
Simplified88.4%
Taylor expanded in t around 0 79.4%
associate-/l*88.1%
Simplified88.1%
Final simplification75.9%
NOTE: x and y 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 (or (<= b -1.7e+33) (not (<= b 2.4e-138)))
(/ (+ t_1 (/ b z)) c)
(/ (+ t_1 (* 9.0 (/ y (/ z x)))) c))))assert(x < y);
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 ((b <= -1.7e+33) || !(b <= 2.4e-138)) {
tmp = (t_1 + (b / z)) / c;
} else {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
}
return tmp;
}
NOTE: x and y 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 ((b <= (-1.7d+33)) .or. (.not. (b <= 2.4d-138))) then
tmp = (t_1 + (b / z)) / c
else
tmp = (t_1 + (9.0d0 * (y / (z / x)))) / c
end if
code = tmp
end function
assert x < y;
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 ((b <= -1.7e+33) || !(b <= 2.4e-138)) {
tmp = (t_1 + (b / z)) / c;
} else {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) tmp = 0 if (b <= -1.7e+33) or not (b <= 2.4e-138): tmp = (t_1 + (b / z)) / c else: tmp = (t_1 + (9.0 * (y / (z / x)))) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if ((b <= -1.7e+33) || !(b <= 2.4e-138)) tmp = Float64(Float64(t_1 + Float64(b / z)) / c); else tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (a * -4.0);
tmp = 0.0;
if ((b <= -1.7e+33) || ~((b <= 2.4e-138)))
tmp = (t_1 + (b / z)) / c;
else
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
end
tmp_2 = tmp;
end
NOTE: x and y 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[Or[LessEqual[b, -1.7e+33], N[Not[LessEqual[b, 2.4e-138]], $MachinePrecision]], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{+33} \lor \neg \left(b \leq 2.4 \cdot 10^{-138}\right):\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\end{array}
\end{array}
if b < -1.7e33 or 2.3999999999999999e-138 < b Initial program 80.9%
associate-/r*78.7%
Simplified86.0%
Taylor expanded in x around 0 74.6%
if -1.7e33 < b < 2.3999999999999999e-138Initial program 82.3%
associate-/r*82.7%
Simplified90.5%
Taylor expanded in x around inf 86.4%
associate-/l*89.8%
Simplified89.8%
Final simplification81.3%
NOTE: x and y 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 c) z)))))
(if (<= t -1.15e+77)
(* -4.0 (/ a (/ c t)))
(if (<= t -5.5e-130)
t_1
(if (<= t 3.6e-267)
(/ 1.0 (* z (/ c b)))
(if (<= t 8e-155)
t_1
(if (<= t 3.4e-124) (/ b (* z c)) (/ (* t (* a -4.0)) c))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * (x * ((y / c) / z));
double tmp;
if (t <= -1.15e+77) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -5.5e-130) {
tmp = t_1;
} else if (t <= 3.6e-267) {
tmp = 1.0 / (z * (c / b));
} else if (t <= 8e-155) {
tmp = t_1;
} else if (t <= 3.4e-124) {
tmp = b / (z * c);
} else {
tmp = (t * (a * -4.0)) / c;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * (x * ((y / c) / z))
if (t <= (-1.15d+77)) then
tmp = (-4.0d0) * (a / (c / t))
else if (t <= (-5.5d-130)) then
tmp = t_1
else if (t <= 3.6d-267) then
tmp = 1.0d0 / (z * (c / b))
else if (t <= 8d-155) then
tmp = t_1
else if (t <= 3.4d-124) then
tmp = b / (z * c)
else
tmp = (t * (a * (-4.0d0))) / c
end if
code = tmp
end function
assert x < y;
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 / c) / z));
double tmp;
if (t <= -1.15e+77) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -5.5e-130) {
tmp = t_1;
} else if (t <= 3.6e-267) {
tmp = 1.0 / (z * (c / b));
} else if (t <= 8e-155) {
tmp = t_1;
} else if (t <= 3.4e-124) {
tmp = b / (z * c);
} else {
tmp = (t * (a * -4.0)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * (x * ((y / c) / z)) tmp = 0 if t <= -1.15e+77: tmp = -4.0 * (a / (c / t)) elif t <= -5.5e-130: tmp = t_1 elif t <= 3.6e-267: tmp = 1.0 / (z * (c / b)) elif t <= 8e-155: tmp = t_1 elif t <= 3.4e-124: tmp = b / (z * c) else: tmp = (t * (a * -4.0)) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(x * Float64(Float64(y / c) / z))) tmp = 0.0 if (t <= -1.15e+77) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (t <= -5.5e-130) tmp = t_1; elseif (t <= 3.6e-267) tmp = Float64(1.0 / Float64(z * Float64(c / b))); elseif (t <= 8e-155) tmp = t_1; elseif (t <= 3.4e-124) tmp = Float64(b / Float64(z * c)); else tmp = Float64(Float64(t * Float64(a * -4.0)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 9.0 * (x * ((y / c) / z));
tmp = 0.0;
if (t <= -1.15e+77)
tmp = -4.0 * (a / (c / t));
elseif (t <= -5.5e-130)
tmp = t_1;
elseif (t <= 3.6e-267)
tmp = 1.0 / (z * (c / b));
elseif (t <= 8e-155)
tmp = t_1;
elseif (t <= 3.4e-124)
tmp = b / (z * c);
else
tmp = (t * (a * -4.0)) / c;
end
tmp_2 = tmp;
end
NOTE: x and y 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 * N[(N[(y / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e+77], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.5e-130], t$95$1, If[LessEqual[t, 3.6e-267], N[(1.0 / N[(z * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-155], t$95$1, If[LessEqual[t, 3.4e-124], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(x \cdot \frac{\frac{y}{c}}{z}\right)\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+77}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-267}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c}{b}}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-155}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-124}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\
\end{array}
\end{array}
if t < -1.14999999999999997e77Initial program 66.9%
associate-/r*67.4%
Simplified87.5%
Taylor expanded in t around inf 63.7%
associate-/l*70.1%
Simplified70.1%
if -1.14999999999999997e77 < t < -5.50000000000000007e-130 or 3.6000000000000001e-267 < t < 8.00000000000000011e-155Initial program 88.6%
associate-/r*77.9%
Simplified82.1%
clear-num82.1%
inv-pow82.1%
Applied egg-rr82.1%
Taylor expanded in x around inf 50.0%
*-commutative50.0%
*-commutative50.0%
associate-*r/50.1%
*-commutative50.1%
associate-/r*54.3%
Simplified54.3%
if -5.50000000000000007e-130 < t < 3.6000000000000001e-267Initial program 80.9%
associate-*l*80.9%
associate-*l*83.7%
Simplified83.7%
clear-num83.5%
inv-pow83.5%
associate-+l-83.5%
associate-*r*83.5%
associate-*r*80.8%
associate-+l-80.8%
+-commutative80.8%
associate-*r*80.8%
*-commutative80.8%
*-commutative80.8%
Applied egg-rr80.8%
Taylor expanded in b around inf 55.8%
associate-/l*53.4%
Simplified53.4%
unpow-153.4%
associate-/r/55.9%
Applied egg-rr55.9%
if 8.00000000000000011e-155 < t < 3.4000000000000001e-124Initial program 84.9%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in b around inf 84.9%
*-commutative84.9%
Simplified84.9%
if 3.4000000000000001e-124 < t Initial program 84.6%
associate-/r*84.3%
Simplified91.7%
Taylor expanded in t around inf 38.5%
associate-*r*38.5%
*-commutative38.5%
*-commutative38.5%
*-commutative38.5%
Simplified38.5%
Final simplification52.8%
NOTE: x and y 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 (<= y -1e-107)
t_1
(if (<= y 1.7e+102)
(/ (+ (* t (* a -4.0)) (/ b z)) c)
(if (<= y 6.5e+241) t_1 (* 9.0 (/ (/ y (/ z x)) c)))))))assert(x < y);
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 (y <= -1e-107) {
tmp = t_1;
} else if (y <= 1.7e+102) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (y <= 6.5e+241) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / (z / x)) / c);
}
return tmp;
}
NOTE: x and y 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 (y <= (-1d-107)) then
tmp = t_1
else if (y <= 1.7d+102) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / c
else if (y <= 6.5d+241) then
tmp = t_1
else
tmp = 9.0d0 * ((y / (z / x)) / c)
end if
code = tmp
end function
assert x < y;
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 (y <= -1e-107) {
tmp = t_1;
} else if (y <= 1.7e+102) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (y <= 6.5e+241) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / (z / x)) / c);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (z * c) tmp = 0 if y <= -1e-107: tmp = t_1 elif y <= 1.7e+102: tmp = ((t * (a * -4.0)) + (b / z)) / c elif y <= 6.5e+241: tmp = t_1 else: tmp = 9.0 * ((y / (z / x)) / c) return tmp
x, y = sort([x, y]) 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 (y <= -1e-107) tmp = t_1; elseif (y <= 1.7e+102) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); elseif (y <= 6.5e+241) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(y / Float64(z / x)) / c)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (x * y))) / (z * c);
tmp = 0.0;
if (y <= -1e-107)
tmp = t_1;
elseif (y <= 1.7e+102)
tmp = ((t * (a * -4.0)) + (b / z)) / c;
elseif (y <= 6.5e+241)
tmp = t_1;
else
tmp = 9.0 * ((y / (z / x)) / c);
end
tmp_2 = tmp;
end
NOTE: x and y 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[y, -1e-107], t$95$1, If[LessEqual[y, 1.7e+102], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 6.5e+241], t$95$1, N[(9.0 * N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+102}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+241}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{\frac{y}{\frac{z}{x}}}{c}\\
\end{array}
\end{array}
if y < -1e-107 or 1.7e102 < y < 6.4999999999999994e241Initial program 80.4%
associate-/r*74.9%
Simplified83.7%
Taylor expanded in z around 0 63.8%
if -1e-107 < y < 1.7e102Initial program 83.9%
associate-/r*83.8%
Simplified93.4%
Taylor expanded in x around 0 82.9%
if 6.4999999999999994e241 < y Initial program 73.4%
associate-/r*84.8%
Simplified84.7%
Taylor expanded in x around inf 57.6%
associate-/l*61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
associate-*l/65.1%
*-commutative65.1%
associate-/r*84.0%
Simplified84.0%
associate-*r/80.3%
Applied egg-rr80.3%
associate-*r/69.1%
*-commutative69.1%
associate-/l*80.4%
Simplified80.4%
Final simplification75.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -2e+174)
(/ (* t (* a -4.0)) c)
(if (<= z 1.1e+71)
(/ (+ b (* 9.0 (* x y))) (* z c))
(* -4.0 (/ a (/ c t))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2e+174) {
tmp = (t * (a * -4.0)) / c;
} else if (z <= 1.1e+71) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
NOTE: x and y 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 <= (-2d+174)) then
tmp = (t * (a * (-4.0d0))) / c
else if (z <= 1.1d+71) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2e+174) {
tmp = (t * (a * -4.0)) / c;
} else if (z <= 1.1e+71) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -2e+174: tmp = (t * (a * -4.0)) / c elif z <= 1.1e+71: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2e+174) tmp = Float64(Float64(t * Float64(a * -4.0)) / c); elseif (z <= 1.1e+71) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -2e+174)
tmp = (t * (a * -4.0)) / c;
elseif (z <= 1.1e+71)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2e+174], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.1e+71], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+174}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+71}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -2.00000000000000014e174Initial program 38.3%
associate-/r*47.3%
Simplified86.5%
Taylor expanded in t around inf 70.3%
associate-*r*70.3%
*-commutative70.3%
*-commutative70.3%
*-commutative70.3%
Simplified70.3%
if -2.00000000000000014e174 < z < 1.09999999999999997e71Initial program 90.4%
associate-/r*85.8%
Simplified88.9%
Taylor expanded in z around 0 71.2%
if 1.09999999999999997e71 < z Initial program 66.0%
associate-/r*74.5%
Simplified89.3%
Taylor expanded in t around inf 67.4%
associate-/l*64.3%
Simplified64.3%
Final simplification69.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= b -5.2e+21)
(/ b (* z c))
(if (<= b 1.9e-249)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= b 1.02e+77) (/ (* t (* a -4.0)) c) (/ 1.0 (* z (/ c b)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -5.2e+21) {
tmp = b / (z * c);
} else if (b <= 1.9e-249) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 1.02e+77) {
tmp = (t * (a * -4.0)) / c;
} else {
tmp = 1.0 / (z * (c / b));
}
return tmp;
}
NOTE: x and y 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 <= (-5.2d+21)) then
tmp = b / (z * c)
else if (b <= 1.9d-249) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (b <= 1.02d+77) then
tmp = (t * (a * (-4.0d0))) / c
else
tmp = 1.0d0 / (z * (c / b))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -5.2e+21) {
tmp = b / (z * c);
} else if (b <= 1.9e-249) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 1.02e+77) {
tmp = (t * (a * -4.0)) / c;
} else {
tmp = 1.0 / (z * (c / b));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -5.2e+21: tmp = b / (z * c) elif b <= 1.9e-249: tmp = 9.0 * ((y / z) * (x / c)) elif b <= 1.02e+77: tmp = (t * (a * -4.0)) / c else: tmp = 1.0 / (z * (c / b)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -5.2e+21) tmp = Float64(b / Float64(z * c)); elseif (b <= 1.9e-249) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (b <= 1.02e+77) tmp = Float64(Float64(t * Float64(a * -4.0)) / c); else tmp = Float64(1.0 / Float64(z * Float64(c / b))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -5.2e+21)
tmp = b / (z * c);
elseif (b <= 1.9e-249)
tmp = 9.0 * ((y / z) * (x / c));
elseif (b <= 1.02e+77)
tmp = (t * (a * -4.0)) / c;
else
tmp = 1.0 / (z * (c / b));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -5.2e+21], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.9e-249], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e+77], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(1.0 / N[(z * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{+21}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{-249}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;b \leq 1.02 \cdot 10^{+77}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c}{b}}\\
\end{array}
\end{array}
if b < -5.2e21Initial program 90.3%
associate-/r*84.8%
Simplified90.6%
Taylor expanded in b around inf 64.0%
*-commutative64.0%
Simplified64.0%
if -5.2e21 < b < 1.9e-249Initial program 81.8%
associate-/r*81.3%
Simplified89.1%
Taylor expanded in x around inf 48.6%
*-commutative48.6%
times-frac53.8%
Simplified53.8%
if 1.9e-249 < b < 1.02e77Initial program 80.1%
associate-/r*81.6%
Simplified88.7%
Taylor expanded in t around inf 53.4%
associate-*r*53.4%
*-commutative53.4%
*-commutative53.4%
*-commutative53.4%
Simplified53.4%
if 1.02e77 < b Initial program 74.2%
associate-*l*74.2%
associate-*l*72.4%
Simplified72.4%
clear-num72.4%
inv-pow72.4%
associate-+l-72.4%
associate-*r*72.4%
associate-*r*74.2%
associate-+l-74.2%
+-commutative74.2%
associate-*r*74.2%
*-commutative74.2%
*-commutative74.2%
Applied egg-rr74.2%
Taylor expanded in b around inf 57.3%
associate-/l*57.5%
Simplified57.5%
unpow-157.5%
associate-/r/59.5%
Applied egg-rr59.5%
Final simplification56.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -4.4e+28) (not (<= t 1.6e-124))) (* -4.0 (* t (/ a c))) (/ b (* z c))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -4.4e+28) || !(t <= 1.6e-124)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
NOTE: x and y 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 <= (-4.4d+28)) .or. (.not. (t <= 1.6d-124))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = b / (z * c)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -4.4e+28) || !(t <= 1.6e-124)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -4.4e+28) or not (t <= 1.6e-124): tmp = -4.0 * (t * (a / c)) else: tmp = b / (z * c) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -4.4e+28) || !(t <= 1.6e-124)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(b / Float64(z * c)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -4.4e+28) || ~((t <= 1.6e-124)))
tmp = -4.0 * (t * (a / c));
else
tmp = b / (z * c);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -4.4e+28], N[Not[LessEqual[t, 1.6e-124]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{+28} \lor \neg \left(t \leq 1.6 \cdot 10^{-124}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if t < -4.39999999999999973e28 or 1.60000000000000002e-124 < t Initial program 78.9%
associate-/r*77.2%
Simplified88.7%
Taylor expanded in t around inf 46.8%
associate-/l*48.9%
associate-/r/47.9%
Simplified47.9%
if -4.39999999999999973e28 < t < 1.60000000000000002e-124Initial program 85.8%
associate-/r*85.8%
Simplified88.9%
Taylor expanded in b around inf 45.2%
*-commutative45.2%
Simplified45.2%
Final simplification46.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -1.22e+28) (not (<= t 1.4e-124))) (* -4.0 (/ a (/ c t))) (/ b (* z c))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.22e+28) || !(t <= 1.4e-124)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b / (z * c);
}
return tmp;
}
NOTE: x and y 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 <= (-1.22d+28)) .or. (.not. (t <= 1.4d-124))) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = b / (z * c)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.22e+28) || !(t <= 1.4e-124)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -1.22e+28) or not (t <= 1.4e-124): tmp = -4.0 * (a / (c / t)) else: tmp = b / (z * c) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -1.22e+28) || !(t <= 1.4e-124)) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(b / Float64(z * c)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -1.22e+28) || ~((t <= 1.4e-124)))
tmp = -4.0 * (a / (c / t));
else
tmp = b / (z * c);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -1.22e+28], N[Not[LessEqual[t, 1.4e-124]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+28} \lor \neg \left(t \leq 1.4 \cdot 10^{-124}\right):\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if t < -1.2199999999999999e28 or 1.39999999999999999e-124 < t Initial program 78.9%
associate-/r*77.2%
Simplified88.7%
Taylor expanded in t around inf 46.8%
associate-/l*48.9%
Simplified48.9%
if -1.2199999999999999e28 < t < 1.39999999999999999e-124Initial program 85.8%
associate-/r*85.8%
Simplified88.9%
Taylor expanded in b around inf 45.2%
*-commutative45.2%
Simplified45.2%
Final simplification47.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -1.3e+28) (not (<= t 2.9e-124))) (* -4.0 (/ a (/ c t))) (* b (/ 1.0 (* z c)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.3e+28) || !(t <= 2.9e-124)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b * (1.0 / (z * c));
}
return tmp;
}
NOTE: x and y 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 <= (-1.3d+28)) .or. (.not. (t <= 2.9d-124))) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = b * (1.0d0 / (z * c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.3e+28) || !(t <= 2.9e-124)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b * (1.0 / (z * c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -1.3e+28) or not (t <= 2.9e-124): tmp = -4.0 * (a / (c / t)) else: tmp = b * (1.0 / (z * c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -1.3e+28) || !(t <= 2.9e-124)) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(b * Float64(1.0 / Float64(z * c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -1.3e+28) || ~((t <= 2.9e-124)))
tmp = -4.0 * (a / (c / t));
else
tmp = b * (1.0 / (z * c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -1.3e+28], N[Not[LessEqual[t, 2.9e-124]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+28} \lor \neg \left(t \leq 2.9 \cdot 10^{-124}\right):\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\end{array}
\end{array}
if t < -1.3000000000000001e28 or 2.9000000000000002e-124 < t Initial program 78.9%
associate-/r*77.2%
Simplified88.7%
Taylor expanded in t around inf 46.8%
associate-/l*48.9%
Simplified48.9%
if -1.3000000000000001e28 < t < 2.9000000000000002e-124Initial program 85.8%
associate-/r*85.8%
Simplified88.9%
Taylor expanded in b around inf 45.2%
*-commutative45.2%
Simplified45.2%
div-inv45.2%
Applied egg-rr45.2%
Final simplification47.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= t -7e+27) (* -4.0 (/ a (/ c t))) (if (<= t 1.75e-124) (* b (/ 1.0 (* z c))) (/ (* t (* a -4.0)) c))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -7e+27) {
tmp = -4.0 * (a / (c / t));
} else if (t <= 1.75e-124) {
tmp = b * (1.0 / (z * c));
} else {
tmp = (t * (a * -4.0)) / c;
}
return tmp;
}
NOTE: x and y 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 <= (-7d+27)) then
tmp = (-4.0d0) * (a / (c / t))
else if (t <= 1.75d-124) then
tmp = b * (1.0d0 / (z * c))
else
tmp = (t * (a * (-4.0d0))) / c
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -7e+27) {
tmp = -4.0 * (a / (c / t));
} else if (t <= 1.75e-124) {
tmp = b * (1.0 / (z * c));
} else {
tmp = (t * (a * -4.0)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -7e+27: tmp = -4.0 * (a / (c / t)) elif t <= 1.75e-124: tmp = b * (1.0 / (z * c)) else: tmp = (t * (a * -4.0)) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -7e+27) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (t <= 1.75e-124) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = Float64(Float64(t * Float64(a * -4.0)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -7e+27)
tmp = -4.0 * (a / (c / t));
elseif (t <= 1.75e-124)
tmp = b * (1.0 / (z * c));
else
tmp = (t * (a * -4.0)) / c;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -7e+27], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-124], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+27}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-124}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\
\end{array}
\end{array}
if t < -7.0000000000000004e27Initial program 71.0%
associate-/r*67.4%
Simplified84.6%
Taylor expanded in t around inf 58.3%
associate-/l*64.8%
Simplified64.8%
if -7.0000000000000004e27 < t < 1.7499999999999999e-124Initial program 85.8%
associate-/r*85.8%
Simplified88.9%
Taylor expanded in b around inf 45.2%
*-commutative45.2%
Simplified45.2%
div-inv45.2%
Applied egg-rr45.2%
if 1.7499999999999999e-124 < t Initial program 84.6%
associate-/r*84.3%
Simplified91.7%
Taylor expanded in t around inf 38.5%
associate-*r*38.5%
*-commutative38.5%
*-commutative38.5%
*-commutative38.5%
Simplified38.5%
Final simplification47.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b / (z * c)
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 81.5%
associate-/r*80.4%
Simplified88.8%
Taylor expanded in b around inf 32.9%
*-commutative32.9%
Simplified32.9%
Final simplification32.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t_4}{z \cdot c}\\
t_6 := \frac{\left(t_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 0:\\
\;\;\;\;\frac{\frac{t_4}{z}}{c}\\
\mathbf{elif}\;t_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t_1\right) - t_2\\
\mathbf{elif}\;t_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t_1\right) - t_2\\
\end{array}
\end{array}
herbie shell --seed 2023200
(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)))