
(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.
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 (<= c -6.7e-37)
(+ (* t (/ a (/ c -4.0))) (/ (- (/ b c) (/ (* x (* y -9.0)) c)) z))
(if (<= c 8.4e-81)
(* (/ (+ b (fma x (* y 9.0) (* a (* z (* t (- 4.0)))))) z) (/ 1.0 c))
(fma (* t (/ a c)) -4.0 (fma 9.0 (* (/ x c) (/ y z)) (/ b (* c z)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -6.7e-37) {
tmp = (t * (a / (c / -4.0))) + (((b / c) - ((x * (y * -9.0)) / c)) / z);
} else if (c <= 8.4e-81) {
tmp = ((b + fma(x, (y * 9.0), (a * (z * (t * -4.0))))) / z) * (1.0 / c);
} else {
tmp = fma((t * (a / c)), -4.0, fma(9.0, ((x / c) * (y / z)), (b / (c * z))));
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -6.7e-37) tmp = Float64(Float64(t * Float64(a / Float64(c / -4.0))) + Float64(Float64(Float64(b / c) - Float64(Float64(x * Float64(y * -9.0)) / c)) / z)); elseif (c <= 8.4e-81) tmp = Float64(Float64(Float64(b + fma(x, Float64(y * 9.0), Float64(a * Float64(z * Float64(t * Float64(-4.0)))))) / z) * Float64(1.0 / c)); else tmp = fma(Float64(t * Float64(a / c)), -4.0, fma(9.0, Float64(Float64(x / c) * Float64(y / z)), Float64(b / Float64(c * z)))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -6.7e-37], N[(N[(t * N[(a / N[(c / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c), $MachinePrecision] - N[(N[(x * N[(y * -9.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 8.4e-81], N[(N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision] + N[(a * N[(z * N[(t * (-4.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.7 \cdot 10^{-37}:\\
\;\;\;\;t \cdot \frac{a}{\frac{c}{-4}} + \frac{\frac{b}{c} - \frac{x \cdot \left(y \cdot -9\right)}{c}}{z}\\
\mathbf{elif}\;c \leq 8.4 \cdot 10^{-81}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, y \cdot 9, a \cdot \left(z \cdot \left(t \cdot \left(-4\right)\right)\right)\right)}{z} \cdot \frac{1}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \frac{a}{c}, -4, \mathsf{fma}\left(9, \frac{x}{c} \cdot \frac{y}{z}, \frac{b}{c \cdot z}\right)\right)\\
\end{array}
\end{array}
if c < -6.70000000000000001e-37Initial program 71.5%
associate-/r*66.5%
associate-+l-66.5%
associate-*r*66.5%
associate-*r*67.9%
div-inv67.9%
associate--r-67.9%
fma-neg67.9%
associate-*r*66.6%
distribute-rgt-neg-in66.6%
associate-*l*66.6%
Applied egg-rr66.6%
Taylor expanded in x around 0 79.7%
Taylor expanded in z around -inf 90.3%
fma-def90.3%
mul-1-neg90.3%
fma-neg90.3%
associate-*r/90.3%
associate-*r*90.3%
associate-*l/93.0%
*-commutative93.0%
*-commutative93.0%
associate-/l*93.0%
mul-1-neg93.0%
unsub-neg93.0%
associate-*r/93.0%
*-commutative93.0%
associate-*l*93.0%
Simplified93.0%
if -6.70000000000000001e-37 < c < 8.3999999999999997e-81Initial program 93.8%
associate-/r*96.4%
associate-+l-96.4%
associate-*r*96.4%
associate-*r*97.2%
div-inv97.2%
associate--r-97.2%
fma-neg97.2%
associate-*r*96.3%
distribute-rgt-neg-in96.3%
associate-*l*96.3%
Applied egg-rr96.3%
if 8.3999999999999997e-81 < c Initial program 76.2%
Taylor expanded in x around 0 81.8%
cancel-sign-sub-inv81.8%
metadata-eval81.8%
+-commutative81.8%
*-commutative81.8%
fma-def81.8%
associate-/l*85.2%
associate-/r/87.8%
fma-def87.8%
times-frac95.7%
*-commutative95.7%
Simplified95.7%
Final simplification95.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(+ (* t (/ a (/ c -4.0))) (/ (- (/ b c) (/ (* x (* y -9.0)) c)) z))))
(if (<= c -1e-35)
t_1
(if (<= c 1.75e+83)
(* (/ (+ b (fma x (* y 9.0) (* a (* z (* t (- 4.0)))))) z) (/ 1.0 c))
(if (<= c 2.1e+153)
(+ (* -4.0 (/ a (/ c t))) (* (/ y z) (* 9.0 (/ x c))))
(if (<= c 2.05e+270)
(-
(+ (/ b (* c z)) (* 9.0 (/ (* x y) (* c z))))
(* 4.0 (/ (* t a) c)))
t_1))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * (a / (c / -4.0))) + (((b / c) - ((x * (y * -9.0)) / c)) / z);
double tmp;
if (c <= -1e-35) {
tmp = t_1;
} else if (c <= 1.75e+83) {
tmp = ((b + fma(x, (y * 9.0), (a * (z * (t * -4.0))))) / z) * (1.0 / c);
} else if (c <= 2.1e+153) {
tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c)));
} else if (c <= 2.05e+270) {
tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * ((t * a) / c));
} else {
tmp = t_1;
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(t * Float64(a / Float64(c / -4.0))) + Float64(Float64(Float64(b / c) - Float64(Float64(x * Float64(y * -9.0)) / c)) / z)) tmp = 0.0 if (c <= -1e-35) tmp = t_1; elseif (c <= 1.75e+83) tmp = Float64(Float64(Float64(b + fma(x, Float64(y * 9.0), Float64(a * Float64(z * Float64(t * Float64(-4.0)))))) / z) * Float64(1.0 / c)); elseif (c <= 2.1e+153) tmp = Float64(Float64(-4.0 * Float64(a / Float64(c / t))) + Float64(Float64(y / z) * Float64(9.0 * Float64(x / c)))); elseif (c <= 2.05e+270) tmp = Float64(Float64(Float64(b / Float64(c * z)) + Float64(9.0 * Float64(Float64(x * y) / Float64(c * z)))) - Float64(4.0 * Float64(Float64(t * a) / c))); else tmp = t_1; end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(t * N[(a / N[(c / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c), $MachinePrecision] - N[(N[(x * N[(y * -9.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1e-35], t$95$1, If[LessEqual[c, 1.75e+83], N[(N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision] + N[(a * N[(z * N[(t * (-4.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.1e+153], N[(N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(9.0 * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.05e+270], N[(N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{a}{\frac{c}{-4}} + \frac{\frac{b}{c} - \frac{x \cdot \left(y \cdot -9\right)}{c}}{z}\\
\mathbf{if}\;c \leq -1 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.75 \cdot 10^{+83}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, y \cdot 9, a \cdot \left(z \cdot \left(t \cdot \left(-4\right)\right)\right)\right)}{z} \cdot \frac{1}{c}\\
\mathbf{elif}\;c \leq 2.1 \cdot 10^{+153}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}} + \frac{y}{z} \cdot \left(9 \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;c \leq 2.05 \cdot 10^{+270}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x \cdot y}{c \cdot z}\right) - 4 \cdot \frac{t \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -1.00000000000000001e-35 or 2.04999999999999998e270 < c Initial program 71.1%
associate-/r*65.4%
associate-+l-65.4%
associate-*r*65.3%
associate-*r*66.6%
div-inv66.6%
associate--r-66.6%
fma-neg66.6%
associate-*r*65.4%
distribute-rgt-neg-in65.4%
associate-*l*65.4%
Applied egg-rr65.4%
Taylor expanded in x around 0 77.5%
Taylor expanded in z around -inf 88.6%
fma-def88.6%
mul-1-neg88.6%
fma-neg88.6%
associate-*r/88.6%
associate-*r*88.6%
associate-*l/92.3%
*-commutative92.3%
*-commutative92.3%
associate-/l*92.3%
mul-1-neg92.3%
unsub-neg92.3%
associate-*r/92.3%
*-commutative92.3%
associate-*l*92.3%
Simplified92.3%
if -1.00000000000000001e-35 < c < 1.74999999999999989e83Initial program 93.5%
associate-/r*94.4%
associate-+l-94.4%
associate-*r*94.4%
associate-*r*95.7%
div-inv95.7%
associate--r-95.7%
fma-neg95.7%
associate-*r*94.3%
distribute-rgt-neg-in94.3%
associate-*l*94.3%
Applied egg-rr94.3%
if 1.74999999999999989e83 < c < 2.10000000000000017e153Initial program 43.2%
associate-/r*55.8%
associate-+l-55.8%
associate-*r*55.9%
associate-*r*55.9%
div-inv55.9%
associate--r-55.9%
fma-neg55.9%
associate-*r*55.9%
distribute-rgt-neg-in55.9%
associate-*l*55.9%
Applied egg-rr55.9%
Taylor expanded in x around 0 61.4%
Taylor expanded in z around -inf 61.4%
fma-def61.4%
mul-1-neg61.4%
fma-neg61.4%
associate-*r/61.4%
associate-*r*61.4%
associate-*l/72.1%
*-commutative72.1%
*-commutative72.1%
associate-/l*72.1%
mul-1-neg72.1%
unsub-neg72.1%
associate-*r/72.0%
*-commutative72.0%
associate-*l*72.2%
Simplified72.2%
Taylor expanded in b around 0 60.9%
cancel-sign-sub-inv60.9%
metadata-eval60.9%
associate-/l*71.6%
times-frac99.7%
associate-*r*99.8%
Simplified99.8%
if 2.10000000000000017e153 < c < 2.04999999999999998e270Initial program 82.1%
Taylor expanded in x around 0 90.9%
Final simplification93.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (+ b (* 9.0 (* x y))) (* c z)))
(t_2 (/ (+ (* -4.0 (* t a)) (/ b z)) c))
(t_3 (* y (* x 9.0))))
(if (<= t_3 -5e+145)
(* x (* (/ y c) (/ 9.0 z)))
(if (<= t_3 -2e+121)
t_2
(if (<= t_3 -5e+53)
t_1
(if (<= t_3 20000000000000.0)
t_2
(if (<= t_3 2e+281) t_1 (* (/ y c) (/ (* x 9.0) z)))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (c * z);
double t_2 = ((-4.0 * (t * a)) + (b / z)) / c;
double t_3 = y * (x * 9.0);
double tmp;
if (t_3 <= -5e+145) {
tmp = x * ((y / c) * (9.0 / z));
} else if (t_3 <= -2e+121) {
tmp = t_2;
} else if (t_3 <= -5e+53) {
tmp = t_1;
} else if (t_3 <= 20000000000000.0) {
tmp = t_2;
} else if (t_3 <= 2e+281) {
tmp = t_1;
} else {
tmp = (y / c) * ((x * 9.0) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b + (9.0d0 * (x * y))) / (c * z)
t_2 = (((-4.0d0) * (t * a)) + (b / z)) / c
t_3 = y * (x * 9.0d0)
if (t_3 <= (-5d+145)) then
tmp = x * ((y / c) * (9.0d0 / z))
else if (t_3 <= (-2d+121)) then
tmp = t_2
else if (t_3 <= (-5d+53)) then
tmp = t_1
else if (t_3 <= 20000000000000.0d0) then
tmp = t_2
else if (t_3 <= 2d+281) then
tmp = t_1
else
tmp = (y / c) * ((x * 9.0d0) / z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (c * z);
double t_2 = ((-4.0 * (t * a)) + (b / z)) / c;
double t_3 = y * (x * 9.0);
double tmp;
if (t_3 <= -5e+145) {
tmp = x * ((y / c) * (9.0 / z));
} else if (t_3 <= -2e+121) {
tmp = t_2;
} else if (t_3 <= -5e+53) {
tmp = t_1;
} else if (t_3 <= 20000000000000.0) {
tmp = t_2;
} else if (t_3 <= 2e+281) {
tmp = t_1;
} else {
tmp = (y / c) * ((x * 9.0) / z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (c * z) t_2 = ((-4.0 * (t * a)) + (b / z)) / c t_3 = y * (x * 9.0) tmp = 0 if t_3 <= -5e+145: tmp = x * ((y / c) * (9.0 / z)) elif t_3 <= -2e+121: tmp = t_2 elif t_3 <= -5e+53: tmp = t_1 elif t_3 <= 20000000000000.0: tmp = t_2 elif t_3 <= 2e+281: tmp = t_1 else: tmp = (y / c) * ((x * 9.0) / z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)) t_2 = Float64(Float64(Float64(-4.0 * Float64(t * a)) + Float64(b / z)) / c) t_3 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if (t_3 <= -5e+145) tmp = Float64(x * Float64(Float64(y / c) * Float64(9.0 / z))); elseif (t_3 <= -2e+121) tmp = t_2; elseif (t_3 <= -5e+53) tmp = t_1; elseif (t_3 <= 20000000000000.0) tmp = t_2; elseif (t_3 <= 2e+281) tmp = t_1; else tmp = Float64(Float64(y / c) * Float64(Float64(x * 9.0) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (x * y))) / (c * z);
t_2 = ((-4.0 * (t * a)) + (b / z)) / c;
t_3 = y * (x * 9.0);
tmp = 0.0;
if (t_3 <= -5e+145)
tmp = x * ((y / c) * (9.0 / z));
elseif (t_3 <= -2e+121)
tmp = t_2;
elseif (t_3 <= -5e+53)
tmp = t_1;
elseif (t_3 <= 20000000000000.0)
tmp = t_2;
elseif (t_3 <= 2e+281)
tmp = t_1;
else
tmp = (y / c) * ((x * 9.0) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+145], N[(x * N[(N[(y / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -2e+121], t$95$2, If[LessEqual[t$95$3, -5e+53], t$95$1, If[LessEqual[t$95$3, 20000000000000.0], t$95$2, If[LessEqual[t$95$3, 2e+281], t$95$1, N[(N[(y / c), $MachinePrecision] * N[(N[(x * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
t_2 := \frac{-4 \cdot \left(t \cdot a\right) + \frac{b}{z}}{c}\\
t_3 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{+145}:\\
\;\;\;\;x \cdot \left(\frac{y}{c} \cdot \frac{9}{z}\right)\\
\mathbf{elif}\;t_3 \leq -2 \cdot 10^{+121}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq 20000000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{c} \cdot \frac{x \cdot 9}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -4.99999999999999967e145Initial program 88.9%
div-inv88.8%
sub-neg88.8%
associate-*r*88.8%
fma-def88.8%
distribute-rgt-neg-in88.8%
associate-*l*88.8%
Applied egg-rr88.8%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
associate-/l*82.1%
*-commutative82.1%
associate-*l/81.9%
associate-*r/82.0%
associate-/l*82.0%
*-commutative82.0%
*-commutative82.0%
times-frac84.6%
Simplified84.6%
if -4.99999999999999967e145 < (*.f64 (*.f64 x 9) y) < -2.00000000000000007e121 or -5.0000000000000004e53 < (*.f64 (*.f64 x 9) y) < 2e13Initial program 81.6%
associate-/r*83.2%
associate-+l-83.2%
associate-*r*83.2%
associate-*r*84.5%
div-inv84.4%
associate--r-84.4%
fma-neg84.4%
associate-*r*83.2%
distribute-rgt-neg-in83.2%
associate-*l*83.2%
Applied egg-rr83.2%
Taylor expanded in x around 0 90.8%
Taylor expanded in x around 0 85.2%
if -2.00000000000000007e121 < (*.f64 (*.f64 x 9) y) < -5.0000000000000004e53 or 2e13 < (*.f64 (*.f64 x 9) y) < 2.0000000000000001e281Initial program 93.3%
Taylor expanded in z around 0 84.5%
if 2.0000000000000001e281 < (*.f64 (*.f64 x 9) y) Initial program 54.0%
Taylor expanded in x around inf 58.1%
associate-*r/54.0%
associate-*r*54.0%
*-commutative54.0%
associate-*r*54.0%
*-commutative54.0%
Simplified54.0%
associate-*r*54.0%
times-frac87.5%
Applied egg-rr87.5%
Final simplification85.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* y (* x 9.0)))
(t_2 (* -4.0 (* t a)))
(t_3 (/ (+ t_2 (/ b z)) c)))
(if (<= t_1 -5e+145)
(* x (* (/ y c) (/ 9.0 z)))
(if (<= t_1 -2e+121)
t_3
(if (<= t_1 -1e+70)
(/ (+ t_2 (* 9.0 (/ (* x y) z))) c)
(if (<= t_1 20000000000000.0)
t_3
(if (<= t_1 2e+281)
(/ (+ b (* 9.0 (* x y))) (* c z))
(* (/ y c) (/ (* x 9.0) z)))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double t_2 = -4.0 * (t * a);
double t_3 = (t_2 + (b / z)) / c;
double tmp;
if (t_1 <= -5e+145) {
tmp = x * ((y / c) * (9.0 / z));
} else if (t_1 <= -2e+121) {
tmp = t_3;
} else if (t_1 <= -1e+70) {
tmp = (t_2 + (9.0 * ((x * y) / z))) / c;
} else if (t_1 <= 20000000000000.0) {
tmp = t_3;
} else if (t_1 <= 2e+281) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = (y / c) * ((x * 9.0) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y * (x * 9.0d0)
t_2 = (-4.0d0) * (t * a)
t_3 = (t_2 + (b / z)) / c
if (t_1 <= (-5d+145)) then
tmp = x * ((y / c) * (9.0d0 / z))
else if (t_1 <= (-2d+121)) then
tmp = t_3
else if (t_1 <= (-1d+70)) then
tmp = (t_2 + (9.0d0 * ((x * y) / z))) / c
else if (t_1 <= 20000000000000.0d0) then
tmp = t_3
else if (t_1 <= 2d+281) then
tmp = (b + (9.0d0 * (x * y))) / (c * z)
else
tmp = (y / c) * ((x * 9.0d0) / z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double t_2 = -4.0 * (t * a);
double t_3 = (t_2 + (b / z)) / c;
double tmp;
if (t_1 <= -5e+145) {
tmp = x * ((y / c) * (9.0 / z));
} else if (t_1 <= -2e+121) {
tmp = t_3;
} else if (t_1 <= -1e+70) {
tmp = (t_2 + (9.0 * ((x * y) / z))) / c;
} else if (t_1 <= 20000000000000.0) {
tmp = t_3;
} else if (t_1 <= 2e+281) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = (y / c) * ((x * 9.0) / z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = y * (x * 9.0) t_2 = -4.0 * (t * a) t_3 = (t_2 + (b / z)) / c tmp = 0 if t_1 <= -5e+145: tmp = x * ((y / c) * (9.0 / z)) elif t_1 <= -2e+121: tmp = t_3 elif t_1 <= -1e+70: tmp = (t_2 + (9.0 * ((x * y) / z))) / c elif t_1 <= 20000000000000.0: tmp = t_3 elif t_1 <= 2e+281: tmp = (b + (9.0 * (x * y))) / (c * z) else: tmp = (y / c) * ((x * 9.0) / z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(x * 9.0)) t_2 = Float64(-4.0 * Float64(t * a)) t_3 = Float64(Float64(t_2 + Float64(b / z)) / c) tmp = 0.0 if (t_1 <= -5e+145) tmp = Float64(x * Float64(Float64(y / c) * Float64(9.0 / z))); elseif (t_1 <= -2e+121) tmp = t_3; elseif (t_1 <= -1e+70) tmp = Float64(Float64(t_2 + Float64(9.0 * Float64(Float64(x * y) / z))) / c); elseif (t_1 <= 20000000000000.0) tmp = t_3; elseif (t_1 <= 2e+281) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); else tmp = Float64(Float64(y / c) * Float64(Float64(x * 9.0) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = y * (x * 9.0);
t_2 = -4.0 * (t * a);
t_3 = (t_2 + (b / z)) / c;
tmp = 0.0;
if (t_1 <= -5e+145)
tmp = x * ((y / c) * (9.0 / z));
elseif (t_1 <= -2e+121)
tmp = t_3;
elseif (t_1 <= -1e+70)
tmp = (t_2 + (9.0 * ((x * y) / z))) / c;
elseif (t_1 <= 20000000000000.0)
tmp = t_3;
elseif (t_1 <= 2e+281)
tmp = (b + (9.0 * (x * y))) / (c * z);
else
tmp = (y / c) * ((x * 9.0) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+145], N[(x * N[(N[(y / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+121], t$95$3, If[LessEqual[t$95$1, -1e+70], N[(N[(t$95$2 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 20000000000000.0], t$95$3, If[LessEqual[t$95$1, 2e+281], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(y / c), $MachinePrecision] * N[(N[(x * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
t_2 := -4 \cdot \left(t \cdot a\right)\\
t_3 := \frac{t_2 + \frac{b}{z}}{c}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+145}:\\
\;\;\;\;x \cdot \left(\frac{y}{c} \cdot \frac{9}{z}\right)\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+121}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+70}:\\
\;\;\;\;\frac{t_2 + 9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{elif}\;t_1 \leq 20000000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{c} \cdot \frac{x \cdot 9}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -4.99999999999999967e145Initial program 88.9%
div-inv88.8%
sub-neg88.8%
associate-*r*88.8%
fma-def88.8%
distribute-rgt-neg-in88.8%
associate-*l*88.8%
Applied egg-rr88.8%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
associate-/l*82.1%
*-commutative82.1%
associate-*l/81.9%
associate-*r/82.0%
associate-/l*82.0%
*-commutative82.0%
*-commutative82.0%
times-frac84.6%
Simplified84.6%
if -4.99999999999999967e145 < (*.f64 (*.f64 x 9) y) < -2.00000000000000007e121 or -1.00000000000000007e70 < (*.f64 (*.f64 x 9) y) < 2e13Initial program 81.4%
associate-/r*83.5%
associate-+l-83.5%
associate-*r*83.5%
associate-*r*84.8%
div-inv84.7%
associate--r-84.7%
fma-neg84.7%
associate-*r*83.5%
distribute-rgt-neg-in83.5%
associate-*l*83.5%
Applied egg-rr83.5%
Taylor expanded in x around 0 91.0%
Taylor expanded in x around 0 84.9%
if -2.00000000000000007e121 < (*.f64 (*.f64 x 9) y) < -1.00000000000000007e70Initial program 99.4%
associate-/r*99.5%
associate-+l-99.5%
associate-*r*99.5%
associate-*r*99.4%
div-inv99.7%
associate--r-99.7%
fma-neg99.7%
associate-*r*99.5%
distribute-rgt-neg-in99.5%
associate-*l*99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 99.5%
Taylor expanded in b around 0 99.7%
if 2e13 < (*.f64 (*.f64 x 9) y) < 2.0000000000000001e281Initial program 93.7%
Taylor expanded in z around 0 85.0%
if 2.0000000000000001e281 < (*.f64 (*.f64 x 9) y) Initial program 54.0%
Taylor expanded in x around inf 58.1%
associate-*r/54.0%
associate-*r*54.0%
*-commutative54.0%
associate-*r*54.0%
*-commutative54.0%
Simplified54.0%
associate-*r*54.0%
times-frac87.5%
Applied egg-rr87.5%
Final simplification85.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a -4.0) (/ 1.0 (/ c t)))) (t_2 (* y (* x 9.0))))
(if (<= t_2 -5e-12)
(* (/ y c) (/ (* x 9.0) z))
(if (<= t_2 -4e-223)
t_1
(if (<= t_2 1e-124)
(/ b (* c z))
(if (<= t_2 2e+17) t_1 (* x (* (/ y c) (/ 9.0 z)))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * -4.0) * (1.0 / (c / t));
double t_2 = y * (x * 9.0);
double tmp;
if (t_2 <= -5e-12) {
tmp = (y / c) * ((x * 9.0) / z);
} else if (t_2 <= -4e-223) {
tmp = t_1;
} else if (t_2 <= 1e-124) {
tmp = b / (c * z);
} else if (t_2 <= 2e+17) {
tmp = t_1;
} else {
tmp = x * ((y / c) * (9.0 / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * (-4.0d0)) * (1.0d0 / (c / t))
t_2 = y * (x * 9.0d0)
if (t_2 <= (-5d-12)) then
tmp = (y / c) * ((x * 9.0d0) / z)
else if (t_2 <= (-4d-223)) then
tmp = t_1
else if (t_2 <= 1d-124) then
tmp = b / (c * z)
else if (t_2 <= 2d+17) then
tmp = t_1
else
tmp = x * ((y / c) * (9.0d0 / z))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * -4.0) * (1.0 / (c / t));
double t_2 = y * (x * 9.0);
double tmp;
if (t_2 <= -5e-12) {
tmp = (y / c) * ((x * 9.0) / z);
} else if (t_2 <= -4e-223) {
tmp = t_1;
} else if (t_2 <= 1e-124) {
tmp = b / (c * z);
} else if (t_2 <= 2e+17) {
tmp = t_1;
} else {
tmp = x * ((y / c) * (9.0 / z));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (a * -4.0) * (1.0 / (c / t)) t_2 = y * (x * 9.0) tmp = 0 if t_2 <= -5e-12: tmp = (y / c) * ((x * 9.0) / z) elif t_2 <= -4e-223: tmp = t_1 elif t_2 <= 1e-124: tmp = b / (c * z) elif t_2 <= 2e+17: tmp = t_1 else: tmp = x * ((y / c) * (9.0 / z)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * -4.0) * Float64(1.0 / Float64(c / t))) t_2 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if (t_2 <= -5e-12) tmp = Float64(Float64(y / c) * Float64(Float64(x * 9.0) / z)); elseif (t_2 <= -4e-223) tmp = t_1; elseif (t_2 <= 1e-124) tmp = Float64(b / Float64(c * z)); elseif (t_2 <= 2e+17) tmp = t_1; else tmp = Float64(x * Float64(Float64(y / c) * Float64(9.0 / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (a * -4.0) * (1.0 / (c / t));
t_2 = y * (x * 9.0);
tmp = 0.0;
if (t_2 <= -5e-12)
tmp = (y / c) * ((x * 9.0) / z);
elseif (t_2 <= -4e-223)
tmp = t_1;
elseif (t_2 <= 1e-124)
tmp = b / (c * z);
elseif (t_2 <= 2e+17)
tmp = t_1;
else
tmp = x * ((y / c) * (9.0 / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * -4.0), $MachinePrecision] * N[(1.0 / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-12], N[(N[(y / c), $MachinePrecision] * N[(N[(x * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -4e-223], t$95$1, If[LessEqual[t$95$2, 1e-124], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+17], t$95$1, N[(x * N[(N[(y / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot -4\right) \cdot \frac{1}{\frac{c}{t}}\\
t_2 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{c} \cdot \frac{x \cdot 9}{z}\\
\mathbf{elif}\;t_2 \leq -4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 10^{-124}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{c} \cdot \frac{9}{z}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -4.9999999999999997e-12Initial program 84.9%
Taylor expanded in x around inf 64.0%
associate-*r/63.9%
associate-*r*64.0%
*-commutative64.0%
associate-*r*63.9%
*-commutative63.9%
Simplified63.9%
associate-*r*64.0%
times-frac65.7%
Applied egg-rr65.7%
if -4.9999999999999997e-12 < (*.f64 (*.f64 x 9) y) < -3.9999999999999999e-223 or 9.99999999999999933e-125 < (*.f64 (*.f64 x 9) y) < 2e17Initial program 78.8%
Taylor expanded in z around inf 54.6%
associate-/l*62.8%
associate-*r/62.8%
*-commutative62.8%
Simplified62.8%
div-inv62.8%
*-commutative62.8%
Applied egg-rr62.8%
if -3.9999999999999999e-223 < (*.f64 (*.f64 x 9) y) < 9.99999999999999933e-125Initial program 87.5%
Taylor expanded in b around inf 65.7%
*-commutative65.7%
Simplified65.7%
if 2e17 < (*.f64 (*.f64 x 9) y) Initial program 77.6%
div-inv77.6%
sub-neg77.6%
associate-*r*77.6%
fma-def77.6%
distribute-rgt-neg-in77.6%
associate-*l*77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 62.0%
*-commutative62.0%
associate-/l*70.3%
*-commutative70.3%
associate-*l/70.4%
associate-*r/68.7%
associate-/l*68.8%
*-commutative68.8%
*-commutative68.8%
times-frac65.5%
Simplified65.5%
Final simplification64.9%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(+ (* t (/ a (/ c -4.0))) (/ (- (/ b c) (/ (* x (* y -9.0)) c)) z))))
(if (<= c -2.9e-37)
t_1
(if (<= c 1.75e+83)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c z))
(if (<= c 2.2e+175)
(+ (* -4.0 (/ a (/ c t))) (* (/ y z) (* 9.0 (/ x c))))
t_1)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * (a / (c / -4.0))) + (((b / c) - ((x * (y * -9.0)) / c)) / z);
double tmp;
if (c <= -2.9e-37) {
tmp = t_1;
} else if (c <= 1.75e+83) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else if (c <= 2.2e+175) {
tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (t * (a / (c / (-4.0d0)))) + (((b / c) - ((x * (y * (-9.0d0))) / c)) / z)
if (c <= (-2.9d-37)) then
tmp = t_1
else if (c <= 1.75d+83) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (c * z)
else if (c <= 2.2d+175) then
tmp = ((-4.0d0) * (a / (c / t))) + ((y / z) * (9.0d0 * (x / c)))
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * (a / (c / -4.0))) + (((b / c) - ((x * (y * -9.0)) / c)) / z);
double tmp;
if (c <= -2.9e-37) {
tmp = t_1;
} else if (c <= 1.75e+83) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else if (c <= 2.2e+175) {
tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c)));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (t * (a / (c / -4.0))) + (((b / c) - ((x * (y * -9.0)) / c)) / z) tmp = 0 if c <= -2.9e-37: tmp = t_1 elif c <= 1.75e+83: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z) elif c <= 2.2e+175: tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c))) else: tmp = t_1 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(t * Float64(a / Float64(c / -4.0))) + Float64(Float64(Float64(b / c) - Float64(Float64(x * Float64(y * -9.0)) / c)) / z)) tmp = 0.0 if (c <= -2.9e-37) tmp = t_1; elseif (c <= 1.75e+83) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); elseif (c <= 2.2e+175) tmp = Float64(Float64(-4.0 * Float64(a / Float64(c / t))) + Float64(Float64(y / z) * Float64(9.0 * Float64(x / c)))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (t * (a / (c / -4.0))) + (((b / c) - ((x * (y * -9.0)) / c)) / z);
tmp = 0.0;
if (c <= -2.9e-37)
tmp = t_1;
elseif (c <= 1.75e+83)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
elseif (c <= 2.2e+175)
tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(t * N[(a / N[(c / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c), $MachinePrecision] - N[(N[(x * N[(y * -9.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.9e-37], t$95$1, If[LessEqual[c, 1.75e+83], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.2e+175], N[(N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(9.0 * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{a}{\frac{c}{-4}} + \frac{\frac{b}{c} - \frac{x \cdot \left(y \cdot -9\right)}{c}}{z}\\
\mathbf{if}\;c \leq -2.9 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.75 \cdot 10^{+83}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+175}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}} + \frac{y}{z} \cdot \left(9 \cdot \frac{x}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -2.90000000000000005e-37 or 2.1999999999999999e175 < c Initial program 74.7%
associate-/r*67.2%
associate-+l-67.2%
associate-*r*67.2%
associate-*r*68.2%
div-inv68.2%
associate--r-68.2%
fma-neg68.2%
associate-*r*67.2%
distribute-rgt-neg-in67.2%
associate-*l*67.2%
Applied egg-rr67.2%
Taylor expanded in x around 0 77.9%
Taylor expanded in z around -inf 88.8%
fma-def88.8%
mul-1-neg88.8%
fma-neg88.8%
associate-*r/88.8%
associate-*r*88.8%
associate-*l/91.8%
*-commutative91.8%
*-commutative91.8%
associate-/l*91.8%
mul-1-neg91.8%
unsub-neg91.8%
associate-*r/91.8%
*-commutative91.8%
associate-*l*91.7%
Simplified91.7%
if -2.90000000000000005e-37 < c < 1.74999999999999989e83Initial program 93.5%
if 1.74999999999999989e83 < c < 2.1999999999999999e175Initial program 44.8%
associate-/r*55.0%
associate-+l-55.0%
associate-*r*55.1%
associate-*r*55.1%
div-inv55.1%
associate--r-55.1%
fma-neg55.1%
associate-*r*55.1%
distribute-rgt-neg-in55.1%
associate-*l*55.1%
Applied egg-rr55.1%
Taylor expanded in x around 0 59.5%
Taylor expanded in z around -inf 59.5%
fma-def59.5%
mul-1-neg59.5%
fma-neg59.5%
associate-*r/59.5%
associate-*r*59.5%
associate-*l/68.1%
*-commutative68.1%
*-commutative68.1%
associate-/l*68.1%
mul-1-neg68.1%
unsub-neg68.1%
associate-*r/63.6%
*-commutative63.6%
associate-*l*63.7%
Simplified63.7%
Taylor expanded in b around 0 54.4%
cancel-sign-sub-inv54.4%
metadata-eval54.4%
associate-/l*63.0%
times-frac90.5%
associate-*r*90.7%
Simplified90.7%
Final simplification92.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -5e+29) (not (<= z 3.2e-73))) (* (/ 1.0 c) (+ (* -4.0 (* t a)) (+ (* 9.0 (/ (* x y) z)) (/ b z)))) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c z))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5e+29) || !(z <= 3.2e-73)) {
tmp = (1.0 / c) * ((-4.0 * (t * a)) + ((9.0 * ((x * y) / z)) + (b / z)));
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-5d+29)) .or. (.not. (z <= 3.2d-73))) then
tmp = (1.0d0 / c) * (((-4.0d0) * (t * a)) + ((9.0d0 * ((x * y) / z)) + (b / z)))
else
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5e+29) || !(z <= 3.2e-73)) {
tmp = (1.0 / c) * ((-4.0 * (t * a)) + ((9.0 * ((x * y) / z)) + (b / z)));
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -5e+29) or not (z <= 3.2e-73): tmp = (1.0 / c) * ((-4.0 * (t * a)) + ((9.0 * ((x * y) / z)) + (b / z))) else: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -5e+29) || !(z <= 3.2e-73)) tmp = Float64(Float64(1.0 / c) * Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z)))); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -5e+29) || ~((z <= 3.2e-73)))
tmp = (1.0 / c) * ((-4.0 * (t * a)) + ((9.0 * ((x * y) / z)) + (b / z)));
else
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -5e+29], N[Not[LessEqual[z, 3.2e-73]], $MachinePrecision]], N[(N[(1.0 / c), $MachinePrecision] * N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+29} \lor \neg \left(z \leq 3.2 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{1}{c} \cdot \left(-4 \cdot \left(t \cdot a\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -5.0000000000000001e29 or 3.19999999999999986e-73 < z Initial program 71.1%
associate-/r*76.4%
associate-+l-76.4%
associate-*r*76.4%
associate-*r*78.5%
div-inv78.5%
associate--r-78.5%
fma-neg78.5%
associate-*r*76.4%
distribute-rgt-neg-in76.4%
associate-*l*76.4%
Applied egg-rr76.4%
Taylor expanded in x around 0 87.0%
if -5.0000000000000001e29 < z < 3.19999999999999986e-73Initial program 94.9%
Final simplification90.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= z 1.4e+179) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c z)) (+ (* -4.0 (/ a (/ c t))) (* (/ y z) (* 9.0 (/ x c))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= 1.4e+179) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= 1.4d+179) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (c * z)
else
tmp = ((-4.0d0) * (a / (c / t))) + ((y / z) * (9.0d0 * (x / c)))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= 1.4e+179) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c)));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= 1.4e+179: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z) else: tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= 1.4e+179) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); else tmp = Float64(Float64(-4.0 * Float64(a / Float64(c / t))) + Float64(Float64(y / z) * Float64(9.0 * Float64(x / c)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= 1.4e+179)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
else
tmp = (-4.0 * (a / (c / t))) + ((y / z) * (9.0 * (x / c)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, 1.4e+179], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(9.0 * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+179}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}} + \frac{y}{z} \cdot \left(9 \cdot \frac{x}{c}\right)\\
\end{array}
\end{array}
if z < 1.4e179Initial program 87.4%
if 1.4e179 < z Initial program 41.1%
associate-/r*52.0%
associate-+l-52.0%
associate-*r*52.0%
associate-*r*51.9%
div-inv52.0%
associate--r-52.0%
fma-neg52.0%
associate-*r*52.1%
distribute-rgt-neg-in52.1%
associate-*l*52.1%
Applied egg-rr52.1%
Taylor expanded in x around 0 79.3%
Taylor expanded in z around -inf 75.6%
fma-def75.6%
mul-1-neg75.6%
fma-neg75.6%
associate-*r/75.6%
associate-*r*75.6%
associate-*l/75.7%
*-commutative75.7%
*-commutative75.7%
associate-/l*75.7%
mul-1-neg75.7%
unsub-neg75.7%
associate-*r/75.7%
*-commutative75.7%
associate-*l*75.6%
Simplified75.6%
Taylor expanded in b around 0 78.8%
cancel-sign-sub-inv78.8%
metadata-eval78.8%
associate-/l*65.8%
times-frac79.6%
associate-*r*79.6%
Simplified79.6%
Final simplification86.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (+ b (* 9.0 (* x y))) (* c z))) (t_2 (* t (/ (* a -4.0) c))))
(if (<= a -3.3e+37)
t_2
(if (<= a 5e+170)
t_1
(if (<= a 1.75e+182)
(* -4.0 (/ (* t a) c))
(if (<= a 1.4e+192) t_1 t_2))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (c * z);
double t_2 = t * ((a * -4.0) / c);
double tmp;
if (a <= -3.3e+37) {
tmp = t_2;
} else if (a <= 5e+170) {
tmp = t_1;
} else if (a <= 1.75e+182) {
tmp = -4.0 * ((t * a) / c);
} else if (a <= 1.4e+192) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b + (9.0d0 * (x * y))) / (c * z)
t_2 = t * ((a * (-4.0d0)) / c)
if (a <= (-3.3d+37)) then
tmp = t_2
else if (a <= 5d+170) then
tmp = t_1
else if (a <= 1.75d+182) then
tmp = (-4.0d0) * ((t * a) / c)
else if (a <= 1.4d+192) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (c * z);
double t_2 = t * ((a * -4.0) / c);
double tmp;
if (a <= -3.3e+37) {
tmp = t_2;
} else if (a <= 5e+170) {
tmp = t_1;
} else if (a <= 1.75e+182) {
tmp = -4.0 * ((t * a) / c);
} else if (a <= 1.4e+192) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (c * z) t_2 = t * ((a * -4.0) / c) tmp = 0 if a <= -3.3e+37: tmp = t_2 elif a <= 5e+170: tmp = t_1 elif a <= 1.75e+182: tmp = -4.0 * ((t * a) / c) elif a <= 1.4e+192: tmp = t_1 else: tmp = t_2 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)) t_2 = Float64(t * Float64(Float64(a * -4.0) / c)) tmp = 0.0 if (a <= -3.3e+37) tmp = t_2; elseif (a <= 5e+170) tmp = t_1; elseif (a <= 1.75e+182) tmp = Float64(-4.0 * Float64(Float64(t * a) / c)); elseif (a <= 1.4e+192) tmp = t_1; else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (x * y))) / (c * z);
t_2 = t * ((a * -4.0) / c);
tmp = 0.0;
if (a <= -3.3e+37)
tmp = t_2;
elseif (a <= 5e+170)
tmp = t_1;
elseif (a <= 1.75e+182)
tmp = -4.0 * ((t * a) / c);
elseif (a <= 1.4e+192)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(a * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.3e+37], t$95$2, If[LessEqual[a, 5e+170], t$95$1, If[LessEqual[a, 1.75e+182], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4e+192], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
t_2 := t \cdot \frac{a \cdot -4}{c}\\
\mathbf{if}\;a \leq -3.3 \cdot 10^{+37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{+182}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -3.3000000000000001e37 or 1.39999999999999988e192 < a Initial program 81.2%
Taylor expanded in z around inf 57.3%
associate-/l*65.0%
associate-*r/65.0%
*-commutative65.0%
Simplified65.0%
associate-/r/68.9%
*-commutative68.9%
Applied egg-rr68.9%
if -3.3000000000000001e37 < a < 4.99999999999999977e170 or 1.75000000000000011e182 < a < 1.39999999999999988e192Initial program 83.5%
Taylor expanded in z around 0 71.5%
if 4.99999999999999977e170 < a < 1.75000000000000011e182Initial program 60.0%
Taylor expanded in z around inf 99.7%
Final simplification71.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (/ (* a -4.0) c))))
(if (<= a -3.3e+37)
t_1
(if (<= a 2.5e+171)
(/ (+ b (* 9.0 (* x y))) (* c z))
(if (<= a 1.9e+182)
(* -4.0 (/ (* t a) c))
(if (<= a 1.25e+189) (/ (+ b (* y (* x 9.0))) (* c z)) t_1))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * ((a * -4.0) / c);
double tmp;
if (a <= -3.3e+37) {
tmp = t_1;
} else if (a <= 2.5e+171) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else if (a <= 1.9e+182) {
tmp = -4.0 * ((t * a) / c);
} else if (a <= 1.25e+189) {
tmp = (b + (y * (x * 9.0))) / (c * z);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((a * (-4.0d0)) / c)
if (a <= (-3.3d+37)) then
tmp = t_1
else if (a <= 2.5d+171) then
tmp = (b + (9.0d0 * (x * y))) / (c * z)
else if (a <= 1.9d+182) then
tmp = (-4.0d0) * ((t * a) / c)
else if (a <= 1.25d+189) then
tmp = (b + (y * (x * 9.0d0))) / (c * z)
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * ((a * -4.0) / c);
double tmp;
if (a <= -3.3e+37) {
tmp = t_1;
} else if (a <= 2.5e+171) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else if (a <= 1.9e+182) {
tmp = -4.0 * ((t * a) / c);
} else if (a <= 1.25e+189) {
tmp = (b + (y * (x * 9.0))) / (c * z);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * ((a * -4.0) / c) tmp = 0 if a <= -3.3e+37: tmp = t_1 elif a <= 2.5e+171: tmp = (b + (9.0 * (x * y))) / (c * z) elif a <= 1.9e+182: tmp = -4.0 * ((t * a) / c) elif a <= 1.25e+189: tmp = (b + (y * (x * 9.0))) / (c * z) else: tmp = t_1 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(Float64(a * -4.0) / c)) tmp = 0.0 if (a <= -3.3e+37) tmp = t_1; elseif (a <= 2.5e+171) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); elseif (a <= 1.9e+182) tmp = Float64(-4.0 * Float64(Float64(t * a) / c)); elseif (a <= 1.25e+189) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c * z)); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * ((a * -4.0) / c);
tmp = 0.0;
if (a <= -3.3e+37)
tmp = t_1;
elseif (a <= 2.5e+171)
tmp = (b + (9.0 * (x * y))) / (c * z);
elseif (a <= 1.9e+182)
tmp = -4.0 * ((t * a) / c);
elseif (a <= 1.25e+189)
tmp = (b + (y * (x * 9.0))) / (c * z);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(N[(a * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.3e+37], t$95$1, If[LessEqual[a, 2.5e+171], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.9e+182], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+189], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{a \cdot -4}{c}\\
\mathbf{if}\;a \leq -3.3 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{+171}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+182}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+189}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -3.3000000000000001e37 or 1.2500000000000001e189 < a Initial program 81.2%
Taylor expanded in z around inf 57.3%
associate-/l*65.0%
associate-*r/65.0%
*-commutative65.0%
Simplified65.0%
associate-/r/68.9%
*-commutative68.9%
Applied egg-rr68.9%
if -3.3000000000000001e37 < a < 2.5000000000000002e171Initial program 83.4%
Taylor expanded in z around 0 71.3%
if 2.5000000000000002e171 < a < 1.90000000000000006e182Initial program 60.0%
Taylor expanded in z around inf 99.7%
if 1.90000000000000006e182 < a < 1.2500000000000001e189Initial program 87.9%
associate-/r*99.2%
associate-+l-99.2%
associate-*r*98.8%
associate-*r*98.8%
div-inv98.8%
associate--r-98.8%
fma-neg98.8%
associate-*r*98.8%
distribute-rgt-neg-in98.8%
associate-*l*98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 87.9%
associate-*r*87.9%
*-commutative87.9%
*-commutative87.9%
*-commutative87.9%
*-commutative87.9%
Simplified87.9%
Final simplification71.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (/ (* a -4.0) c))))
(if (<= t -3.2e+51)
t_1
(if (<= t -2e-99)
(* 9.0 (/ (* x y) (* c z)))
(if (<= t 3.7e-202) (* (/ b c) (/ 1.0 z)) t_1)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * ((a * -4.0) / c);
double tmp;
if (t <= -3.2e+51) {
tmp = t_1;
} else if (t <= -2e-99) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (t <= 3.7e-202) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((a * (-4.0d0)) / c)
if (t <= (-3.2d+51)) then
tmp = t_1
else if (t <= (-2d-99)) then
tmp = 9.0d0 * ((x * y) / (c * z))
else if (t <= 3.7d-202) then
tmp = (b / c) * (1.0d0 / z)
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * ((a * -4.0) / c);
double tmp;
if (t <= -3.2e+51) {
tmp = t_1;
} else if (t <= -2e-99) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (t <= 3.7e-202) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * ((a * -4.0) / c) tmp = 0 if t <= -3.2e+51: tmp = t_1 elif t <= -2e-99: tmp = 9.0 * ((x * y) / (c * z)) elif t <= 3.7e-202: tmp = (b / c) * (1.0 / z) else: tmp = t_1 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(Float64(a * -4.0) / c)) tmp = 0.0 if (t <= -3.2e+51) tmp = t_1; elseif (t <= -2e-99) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))); elseif (t <= 3.7e-202) tmp = Float64(Float64(b / c) * Float64(1.0 / z)); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * ((a * -4.0) / c);
tmp = 0.0;
if (t <= -3.2e+51)
tmp = t_1;
elseif (t <= -2e-99)
tmp = 9.0 * ((x * y) / (c * z));
elseif (t <= 3.7e-202)
tmp = (b / c) * (1.0 / z);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(N[(a * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e+51], t$95$1, If[LessEqual[t, -2e-99], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-202], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{a \cdot -4}{c}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-99}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-202}:\\
\;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.2000000000000002e51 or 3.69999999999999991e-202 < t Initial program 77.1%
Taylor expanded in z around inf 45.7%
associate-/l*49.9%
associate-*r/49.9%
*-commutative49.9%
Simplified49.9%
associate-/r/50.2%
*-commutative50.2%
Applied egg-rr50.2%
if -3.2000000000000002e51 < t < -2e-99Initial program 96.2%
Taylor expanded in x around inf 58.7%
if -2e-99 < t < 3.69999999999999991e-202Initial program 86.3%
Taylor expanded in b around inf 49.6%
*-commutative49.6%
Simplified49.6%
*-un-lft-identity49.6%
times-frac51.7%
Applied egg-rr51.7%
Final simplification51.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (/ (* a -4.0) c))))
(if (<= t -1.25e+53)
t_1
(if (<= t -4.8e-98)
(* (/ x c) (/ (* y 9.0) z))
(if (<= t 3.8e-202) (* (/ b c) (/ 1.0 z)) t_1)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * ((a * -4.0) / c);
double tmp;
if (t <= -1.25e+53) {
tmp = t_1;
} else if (t <= -4.8e-98) {
tmp = (x / c) * ((y * 9.0) / z);
} else if (t <= 3.8e-202) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((a * (-4.0d0)) / c)
if (t <= (-1.25d+53)) then
tmp = t_1
else if (t <= (-4.8d-98)) then
tmp = (x / c) * ((y * 9.0d0) / z)
else if (t <= 3.8d-202) then
tmp = (b / c) * (1.0d0 / z)
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * ((a * -4.0) / c);
double tmp;
if (t <= -1.25e+53) {
tmp = t_1;
} else if (t <= -4.8e-98) {
tmp = (x / c) * ((y * 9.0) / z);
} else if (t <= 3.8e-202) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * ((a * -4.0) / c) tmp = 0 if t <= -1.25e+53: tmp = t_1 elif t <= -4.8e-98: tmp = (x / c) * ((y * 9.0) / z) elif t <= 3.8e-202: tmp = (b / c) * (1.0 / z) else: tmp = t_1 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(Float64(a * -4.0) / c)) tmp = 0.0 if (t <= -1.25e+53) tmp = t_1; elseif (t <= -4.8e-98) tmp = Float64(Float64(x / c) * Float64(Float64(y * 9.0) / z)); elseif (t <= 3.8e-202) tmp = Float64(Float64(b / c) * Float64(1.0 / z)); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * ((a * -4.0) / c);
tmp = 0.0;
if (t <= -1.25e+53)
tmp = t_1;
elseif (t <= -4.8e-98)
tmp = (x / c) * ((y * 9.0) / z);
elseif (t <= 3.8e-202)
tmp = (b / c) * (1.0 / z);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(N[(a * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e+53], t$95$1, If[LessEqual[t, -4.8e-98], N[(N[(x / c), $MachinePrecision] * N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-202], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{a \cdot -4}{c}\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-98}:\\
\;\;\;\;\frac{x}{c} \cdot \frac{y \cdot 9}{z}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-202}:\\
\;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.2500000000000001e53 or 3.80000000000000014e-202 < t Initial program 77.1%
Taylor expanded in z around inf 45.7%
associate-/l*49.9%
associate-*r/49.9%
*-commutative49.9%
Simplified49.9%
associate-/r/50.2%
*-commutative50.2%
Applied egg-rr50.2%
if -1.2500000000000001e53 < t < -4.8000000000000001e-98Initial program 96.2%
Taylor expanded in x around inf 58.7%
associate-*r/58.7%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
*-commutative58.6%
Simplified58.6%
*-commutative58.6%
times-frac49.9%
Applied egg-rr49.9%
if -4.8000000000000001e-98 < t < 3.80000000000000014e-202Initial program 86.3%
Taylor expanded in b around inf 49.6%
*-commutative49.6%
Simplified49.6%
*-un-lft-identity49.6%
times-frac51.7%
Applied egg-rr51.7%
Final simplification50.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= a -5.8e-69) (not (<= a 4.6e+115))) (* -4.0 (/ (* t a) c)) (/ (/ b z) c)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -5.8e-69) || !(a <= 4.6e+115)) {
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.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a <= (-5.8d-69)) .or. (.not. (a <= 4.6d+115))) then
tmp = (-4.0d0) * ((t * a) / c)
else
tmp = (b / z) / c
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -5.8e-69) || !(a <= 4.6e+115)) {
tmp = -4.0 * ((t * a) / c);
} else {
tmp = (b / z) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -5.8e-69) or not (a <= 4.6e+115): tmp = -4.0 * ((t * a) / c) else: tmp = (b / z) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -5.8e-69) || !(a <= 4.6e+115)) tmp = Float64(-4.0 * Float64(Float64(t * a) / c)); else tmp = Float64(Float64(b / z) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((a <= -5.8e-69) || ~((a <= 4.6e+115)))
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. 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[a, -5.8e-69], N[Not[LessEqual[a, 4.6e+115]], $MachinePrecision]], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-69} \lor \neg \left(a \leq 4.6 \cdot 10^{+115}\right):\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if a < -5.7999999999999997e-69 or 4.60000000000000007e115 < a Initial program 79.8%
Taylor expanded in z around inf 50.1%
if -5.7999999999999997e-69 < a < 4.60000000000000007e115Initial program 84.9%
associate-/r*82.2%
associate-+l-82.2%
associate-*r*82.2%
associate-*r*84.4%
div-inv84.3%
associate--r-84.3%
fma-neg84.3%
associate-*r*82.1%
distribute-rgt-neg-in82.1%
associate-*l*82.1%
Applied egg-rr82.1%
Taylor expanded in x around 0 84.2%
Taylor expanded in b around inf 44.5%
associate-/l/43.7%
Simplified43.7%
Final simplification46.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.95e-69) (not (<= a 4.6e+115))) (* t (/ (* a -4.0) c)) (/ (/ b z) c)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.95e-69) || !(a <= 4.6e+115)) {
tmp = t * ((a * -4.0) / c);
} else {
tmp = (b / z) / c;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a <= (-1.95d-69)) .or. (.not. (a <= 4.6d+115))) then
tmp = t * ((a * (-4.0d0)) / c)
else
tmp = (b / z) / c
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.95e-69) || !(a <= 4.6e+115)) {
tmp = t * ((a * -4.0) / c);
} else {
tmp = (b / z) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -1.95e-69) or not (a <= 4.6e+115): tmp = t * ((a * -4.0) / c) else: tmp = (b / z) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -1.95e-69) || !(a <= 4.6e+115)) tmp = Float64(t * Float64(Float64(a * -4.0) / c)); else tmp = Float64(Float64(b / z) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((a <= -1.95e-69) || ~((a <= 4.6e+115)))
tmp = t * ((a * -4.0) / 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. 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[a, -1.95e-69], N[Not[LessEqual[a, 4.6e+115]], $MachinePrecision]], N[(t * N[(N[(a * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-69} \lor \neg \left(a \leq 4.6 \cdot 10^{+115}\right):\\
\;\;\;\;t \cdot \frac{a \cdot -4}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if a < -1.9499999999999999e-69 or 4.60000000000000007e115 < a Initial program 79.8%
Taylor expanded in z around inf 50.1%
associate-/l*53.0%
associate-*r/53.0%
*-commutative53.0%
Simplified53.0%
associate-/r/54.6%
*-commutative54.6%
Applied egg-rr54.6%
if -1.9499999999999999e-69 < a < 4.60000000000000007e115Initial program 84.9%
associate-/r*82.2%
associate-+l-82.2%
associate-*r*82.2%
associate-*r*84.4%
div-inv84.3%
associate--r-84.3%
fma-neg84.3%
associate-*r*82.1%
distribute-rgt-neg-in82.1%
associate-*l*82.1%
Applied egg-rr82.1%
Taylor expanded in x around 0 84.2%
Taylor expanded in b around inf 44.5%
associate-/l/43.7%
Simplified43.7%
Final simplification49.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b / (c * z)
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (c * z)
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (c * z);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 82.4%
Taylor expanded in b around inf 37.7%
*-commutative37.7%
Simplified37.7%
Final simplification37.7%
(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 2023320
(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)))