
(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 18 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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -2e-73)
t_1
(if (<= t_1 0.0)
(* (/ (fma x (* 9.0 y) (fma t (* z (* a -4.0)) b)) z) (/ 1.0 c))
(if (<= t_1 INFINITY)
t_1
(fma
(* a (/ (- t) (- c)))
-4.0
(fma 9.0 (* (/ x z) (/ y 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 t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-73) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (fma(x, (9.0 * y), fma(t, (z * (a * -4.0)), b)) / z) * (1.0 / c);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma((a * (-t / -c)), -4.0, fma(9.0, ((x / z) * (y / c)), (b / (z * c))));
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-73) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(fma(x, Float64(9.0 * y), fma(t, Float64(z * Float64(a * -4.0)), b)) / z) * Float64(1.0 / c)); elseif (t_1 <= Inf) tmp = t_1; else tmp = fma(Float64(a * Float64(Float64(-t) / Float64(-c))), -4.0, fma(9.0, Float64(Float64(x / z) * Float64(y / c)), Float64(b / Float64(z * c)))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -2e-73], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * N[((-t) / (-c)), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \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}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, z \cdot \left(a \cdot -4\right), b\right)\right)}{z} \cdot \frac{1}{c}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot \frac{-t}{-c}, -4, \mathsf{fma}\left(9, \frac{x}{z} \cdot \frac{y}{c}, \frac{b}{z \cdot c}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -1.99999999999999999e-73 or -0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 94.6%
if -1.99999999999999999e-73 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -0.0Initial program 60.5%
associate-+l-60.5%
div-sub60.5%
*-commutative60.5%
associate-*r*56.2%
*-commutative56.2%
div-sub56.2%
associate-+l-56.2%
Simplified60.4%
associate-+l-60.4%
associate-+l-60.4%
sub-neg60.4%
associate-+l+60.4%
distribute-lft-neg-in60.4%
*-commutative60.4%
associate-*r*56.2%
distribute-rgt-neg-in56.2%
metadata-eval56.2%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
+-commutative56.2%
fma-udef56.2%
Applied egg-rr84.0%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
div-sub0.0%
*-commutative0.0%
associate-*r*0.7%
*-commutative0.7%
div-sub0.7%
associate-+l-0.7%
Simplified0.7%
Taylor expanded in x around 0 32.9%
cancel-sign-sub-inv32.9%
metadata-eval32.9%
+-commutative32.9%
*-commutative32.9%
fma-def32.9%
associate-/l*50.1%
associate-/r/38.6%
fma-def38.6%
*-commutative38.6%
times-frac79.4%
*-commutative79.4%
Simplified79.4%
*-commutative79.4%
frac-2neg79.4%
associate-*r/73.7%
Applied egg-rr73.7%
associate-/l*78.0%
associate-/r/90.5%
Simplified90.5%
Final simplification93.0%
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 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -2e-73)
t_1
(if (<= t_1 0.0)
(* (/ (fma x (* 9.0 y) (fma t (* z (* a -4.0)) b)) z) (/ 1.0 c))
(if (<= t_1 INFINITY)
t_1
(fma
(* t (/ a c))
-4.0
(fma 9.0 (* (/ x z) (/ y 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 t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-73) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (fma(x, (9.0 * y), fma(t, (z * (a * -4.0)), b)) / z) * (1.0 / c);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma((t * (a / c)), -4.0, fma(9.0, ((x / z) * (y / c)), (b / (z * c))));
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-73) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(fma(x, Float64(9.0 * y), fma(t, Float64(z * Float64(a * -4.0)), b)) / z) * Float64(1.0 / c)); elseif (t_1 <= Inf) tmp = t_1; else tmp = fma(Float64(t * Float64(a / c)), -4.0, fma(9.0, Float64(Float64(x / z) * Float64(y / c)), Float64(b / Float64(z * c)))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -2e-73], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \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}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, z \cdot \left(a \cdot -4\right), b\right)\right)}{z} \cdot \frac{1}{c}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \frac{a}{c}, -4, \mathsf{fma}\left(9, \frac{x}{z} \cdot \frac{y}{c}, \frac{b}{z \cdot c}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -1.99999999999999999e-73 or -0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 94.6%
if -1.99999999999999999e-73 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -0.0Initial program 60.5%
associate-+l-60.5%
div-sub60.5%
*-commutative60.5%
associate-*r*56.2%
*-commutative56.2%
div-sub56.2%
associate-+l-56.2%
Simplified60.4%
associate-+l-60.4%
associate-+l-60.4%
sub-neg60.4%
associate-+l+60.4%
distribute-lft-neg-in60.4%
*-commutative60.4%
associate-*r*56.2%
distribute-rgt-neg-in56.2%
metadata-eval56.2%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
+-commutative56.2%
fma-udef56.2%
Applied egg-rr84.0%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
div-sub0.0%
*-commutative0.0%
associate-*r*0.7%
*-commutative0.7%
div-sub0.7%
associate-+l-0.7%
Simplified0.7%
Taylor expanded in x around 0 32.9%
cancel-sign-sub-inv32.9%
metadata-eval32.9%
+-commutative32.9%
*-commutative32.9%
fma-def32.9%
associate-/l*50.1%
associate-/r/38.6%
fma-def38.6%
*-commutative38.6%
times-frac79.4%
*-commutative79.4%
Simplified79.4%
Final simplification92.0%
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 -2e+108) (not (<= z 4.3e+70))) (- (+ (/ b (* z c)) (* 9.0 (/ (* x y) (* z c)))) (* 4.0 (/ (* t a) c))) (* (/ 1.0 z) (/ (fma x (* 9.0 y) (fma t (* z (* a -4.0)) b)) c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2e+108) || !(z <= 4.3e+70)) {
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((t * a) / c));
} else {
tmp = (1.0 / z) * (fma(x, (9.0 * y), fma(t, (z * (a * -4.0)), b)) / c);
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2e+108) || !(z <= 4.3e+70)) tmp = Float64(Float64(Float64(b / Float64(z * c)) + Float64(9.0 * Float64(Float64(x * y) / Float64(z * c)))) - Float64(4.0 * Float64(Float64(t * a) / c))); else tmp = Float64(Float64(1.0 / z) * Float64(fma(x, Float64(9.0 * y), fma(t, Float64(z * Float64(a * -4.0)), b)) / c)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -2e+108], N[Not[LessEqual[z, 4.3e+70]], $MachinePrecision]], N[(N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+108} \lor \neg \left(z \leq 4.3 \cdot 10^{+70}\right):\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, z \cdot \left(a \cdot -4\right), b\right)\right)}{c}\\
\end{array}
\end{array}
if z < -2.0000000000000001e108 or 4.3000000000000001e70 < z Initial program 60.8%
associate-+l-60.8%
div-sub60.8%
*-commutative60.8%
associate-*r*60.3%
*-commutative60.3%
div-sub60.4%
associate-+l-60.4%
Simplified64.5%
Taylor expanded in x around 0 81.6%
if -2.0000000000000001e108 < z < 4.3000000000000001e70Initial program 92.1%
associate-+l-92.1%
div-sub80.8%
*-commutative80.8%
associate-*r*80.8%
*-commutative80.8%
div-sub92.1%
associate-+l-92.1%
Simplified90.0%
sub-neg90.0%
associate-+l+90.0%
distribute-lft-neg-in90.0%
*-commutative90.0%
associate-*r*92.1%
distribute-rgt-neg-in92.1%
metadata-eval92.1%
associate-*r*92.1%
*-commutative92.1%
*-commutative92.1%
+-commutative92.1%
*-un-lft-identity92.1%
fma-udef92.1%
Applied egg-rr94.8%
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 (or (<= z -1.95e+108) (not (<= z 1.75e+70))) (- (+ (/ b (* z c)) (* 9.0 (/ (* x y) (* z c)))) (* 4.0 (/ (* t a) c))) (/ (/ 1.0 z) (/ c (fma x (* 9.0 y) (fma t (* z (* a -4.0)) b))))))
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.95e+108) || !(z <= 1.75e+70)) {
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((t * a) / c));
} else {
tmp = (1.0 / z) / (c / fma(x, (9.0 * y), fma(t, (z * (a * -4.0)), b)));
}
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.95e+108) || !(z <= 1.75e+70)) tmp = Float64(Float64(Float64(b / Float64(z * c)) + Float64(9.0 * Float64(Float64(x * y) / Float64(z * c)))) - Float64(4.0 * Float64(Float64(t * a) / c))); else tmp = Float64(Float64(1.0 / z) / Float64(c / fma(x, Float64(9.0 * y), fma(t, Float64(z * Float64(a * -4.0)), b)))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.95e+108], N[Not[LessEqual[z, 1.75e+70]], $MachinePrecision]], N[(N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] / N[(c / N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + b), $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.95 \cdot 10^{+108} \lor \neg \left(z \leq 1.75 \cdot 10^{+70}\right):\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{c}{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, z \cdot \left(a \cdot -4\right), b\right)\right)}}\\
\end{array}
\end{array}
if z < -1.94999999999999992e108 or 1.75000000000000001e70 < z Initial program 60.8%
associate-+l-60.8%
div-sub60.8%
*-commutative60.8%
associate-*r*60.3%
*-commutative60.3%
div-sub60.4%
associate-+l-60.4%
Simplified64.5%
Taylor expanded in x around 0 81.6%
if -1.94999999999999992e108 < z < 1.75000000000000001e70Initial program 92.1%
associate-+l-92.1%
div-sub80.8%
*-commutative80.8%
associate-*r*80.8%
*-commutative80.8%
div-sub92.1%
associate-+l-92.1%
Simplified90.0%
sub-neg90.0%
associate-+l+90.0%
distribute-lft-neg-in90.0%
*-commutative90.0%
associate-*r*92.1%
distribute-rgt-neg-in92.1%
metadata-eval92.1%
associate-*r*92.1%
*-commutative92.1%
*-commutative92.1%
+-commutative92.1%
*-un-lft-identity92.1%
fma-udef92.1%
Applied egg-rr94.8%
clear-num94.8%
un-div-inv94.8%
Applied egg-rr94.8%
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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -2e-294)
t_1
(if (<= t_1 0.0)
(/ (* x 9.0) (* z (/ c y)))
(if (<= t_1 INFINITY) t_1 (/ (* a -4.0) (/ c t)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-294) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (x * 9.0) / (z * (c / y));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * -4.0) / (c / t);
}
return tmp;
}
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 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-294) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (x * 9.0) / (z * (c / y));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a * -4.0) / (c / t);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c) tmp = 0 if t_1 <= -2e-294: tmp = t_1 elif t_1 <= 0.0: tmp = (x * 9.0) / (z * (c / y)) elif t_1 <= math.inf: tmp = t_1 else: tmp = (a * -4.0) / (c / t) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-294) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(x * 9.0) / Float64(z * Float64(c / y))); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a * -4.0) / Float64(c / t)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
tmp = 0.0;
if (t_1 <= -2e-294)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = (x * 9.0) / (z * (c / y));
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = (a * -4.0) / (c / t);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(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]}, If[LessEqual[t$95$1, -2e-294], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(x * 9.0), $MachinePrecision] / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * -4.0), $MachinePrecision] / N[(c / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \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}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-294}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{x \cdot 9}{z \cdot \frac{c}{y}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot -4}{\frac{c}{t}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -2.00000000000000003e-294 or -0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 94.9%
if -2.00000000000000003e-294 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -0.0Initial program 38.9%
associate-+l-38.9%
div-sub38.9%
*-commutative38.9%
associate-*r*32.3%
*-commutative32.3%
div-sub32.3%
associate-+l-32.3%
Simplified38.9%
Taylor expanded in x around inf 38.9%
*-commutative38.9%
associate-/l*38.9%
associate-*l/38.9%
*-commutative38.9%
*-un-lft-identity38.9%
times-frac53.2%
/-rgt-identity53.2%
Applied egg-rr53.2%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
div-sub0.0%
*-commutative0.0%
associate-*r*0.7%
*-commutative0.7%
div-sub0.7%
associate-+l-0.7%
Simplified0.7%
Taylor expanded in z around inf 38.4%
associate-/l*55.6%
associate-*r/55.6%
*-commutative55.6%
Simplified55.6%
Final simplification88.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 (if (or (<= z -4.4e+128) (not (<= z 1.16e+19))) (- (+ (/ b (* z c)) (* 9.0 (/ (* x y) (* z c)))) (* 4.0 (/ (* t a) c))) (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) 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 ((z <= -4.4e+128) || !(z <= 1.16e+19)) {
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((t * a) / c));
} else {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + 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 ((z <= (-4.4d+128)) .or. (.not. (z <= 1.16d+19))) then
tmp = ((b / (z * c)) + (9.0d0 * ((x * y) / (z * c)))) - (4.0d0 * ((t * a) / c))
else
tmp = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + 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 ((z <= -4.4e+128) || !(z <= 1.16e+19)) {
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((t * a) / c));
} else {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + 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 (z <= -4.4e+128) or not (z <= 1.16e+19): tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((t * a) / c)) else: tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + 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 ((z <= -4.4e+128) || !(z <= 1.16e+19)) tmp = Float64(Float64(Float64(b / Float64(z * c)) + Float64(9.0 * Float64(Float64(x * y) / Float64(z * c)))) - Float64(4.0 * Float64(Float64(t * a) / c))); else tmp = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(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 ((z <= -4.4e+128) || ~((z <= 1.16e+19)))
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((t * a) / c));
else
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + 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[z, -4.4e+128], N[Not[LessEqual[z, 1.16e+19]], $MachinePrecision]], N[(N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+128} \lor \neg \left(z \leq 1.16 \cdot 10^{+19}\right):\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;\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}
\end{array}
if z < -4.40000000000000033e128 or 1.16e19 < z Initial program 63.7%
associate-+l-63.7%
div-sub63.7%
*-commutative63.7%
associate-*r*62.3%
*-commutative62.3%
div-sub62.3%
associate-+l-62.3%
Simplified66.0%
Taylor expanded in x around 0 81.8%
if -4.40000000000000033e128 < z < 1.16e19Initial program 92.8%
Final simplification88.8%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= z 6.6e+167) (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c)) (+ (/ b (* z c)) (* -4.0 (/ (* t a) 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 <= 6.6e+167) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
} else {
tmp = (b / (z * c)) + (-4.0 * ((t * a) / 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 <= 6.6d+167) then
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (z * c)
else
tmp = (b / (z * c)) + ((-4.0d0) * ((t * a) / 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 <= 6.6e+167) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
} else {
tmp = (b / (z * c)) + (-4.0 * ((t * a) / 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 <= 6.6e+167: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c) else: tmp = (b / (z * c)) + (-4.0 * ((t * a) / 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 <= 6.6e+167) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c)); else tmp = Float64(Float64(b / Float64(z * c)) + Float64(-4.0 * Float64(Float64(t * a) / 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 <= 6.6e+167)
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
else
tmp = (b / (z * c)) + (-4.0 * ((t * a) / 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, 6.6e+167], 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], N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c), $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 6.6 \cdot 10^{+167}:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c} + -4 \cdot \frac{t \cdot a}{c}\\
\end{array}
\end{array}
if z < 6.60000000000000036e167Initial program 87.0%
associate-+l-87.0%
div-sub78.2%
*-commutative78.2%
associate-*r*78.1%
*-commutative78.1%
div-sub86.9%
associate-+l-86.9%
Simplified86.6%
if 6.60000000000000036e167 < z Initial program 45.8%
associate-+l-45.8%
div-sub45.8%
*-commutative45.8%
associate-*r*45.6%
*-commutative45.6%
div-sub45.6%
associate-+l-45.6%
Simplified46.1%
Taylor expanded in x around 0 36.2%
Taylor expanded in b around 0 70.4%
Final simplification84.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 (/ (/ 1.0 z) (/ c b))) (t_2 (* 9.0 (* y (/ x (* z c))))))
(if (<= b -2.2e+36)
t_1
(if (<= b -5.4e-22)
(* a (* t (/ -4.0 c)))
(if (<= b -3.8e-264)
t_2
(if (<= b 5.2e-89)
(* -4.0 (* (/ 1.0 c) (* t a)))
(if (<= b 9.5e+67) t_2 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 = (1.0 / z) / (c / b);
double t_2 = 9.0 * (y * (x / (z * c)));
double tmp;
if (b <= -2.2e+36) {
tmp = t_1;
} else if (b <= -5.4e-22) {
tmp = a * (t * (-4.0 / c));
} else if (b <= -3.8e-264) {
tmp = t_2;
} else if (b <= 5.2e-89) {
tmp = -4.0 * ((1.0 / c) * (t * a));
} else if (b <= 9.5e+67) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (1.0d0 / z) / (c / b)
t_2 = 9.0d0 * (y * (x / (z * c)))
if (b <= (-2.2d+36)) then
tmp = t_1
else if (b <= (-5.4d-22)) then
tmp = a * (t * ((-4.0d0) / c))
else if (b <= (-3.8d-264)) then
tmp = t_2
else if (b <= 5.2d-89) then
tmp = (-4.0d0) * ((1.0d0 / c) * (t * a))
else if (b <= 9.5d+67) then
tmp = t_2
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 = (1.0 / z) / (c / b);
double t_2 = 9.0 * (y * (x / (z * c)));
double tmp;
if (b <= -2.2e+36) {
tmp = t_1;
} else if (b <= -5.4e-22) {
tmp = a * (t * (-4.0 / c));
} else if (b <= -3.8e-264) {
tmp = t_2;
} else if (b <= 5.2e-89) {
tmp = -4.0 * ((1.0 / c) * (t * a));
} else if (b <= 9.5e+67) {
tmp = t_2;
} 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 = (1.0 / z) / (c / b) t_2 = 9.0 * (y * (x / (z * c))) tmp = 0 if b <= -2.2e+36: tmp = t_1 elif b <= -5.4e-22: tmp = a * (t * (-4.0 / c)) elif b <= -3.8e-264: tmp = t_2 elif b <= 5.2e-89: tmp = -4.0 * ((1.0 / c) * (t * a)) elif b <= 9.5e+67: tmp = t_2 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(1.0 / z) / Float64(c / b)) t_2 = Float64(9.0 * Float64(y * Float64(x / Float64(z * c)))) tmp = 0.0 if (b <= -2.2e+36) tmp = t_1; elseif (b <= -5.4e-22) tmp = Float64(a * Float64(t * Float64(-4.0 / c))); elseif (b <= -3.8e-264) tmp = t_2; elseif (b <= 5.2e-89) tmp = Float64(-4.0 * Float64(Float64(1.0 / c) * Float64(t * a))); elseif (b <= 9.5e+67) tmp = t_2; 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 = (1.0 / z) / (c / b);
t_2 = 9.0 * (y * (x / (z * c)));
tmp = 0.0;
if (b <= -2.2e+36)
tmp = t_1;
elseif (b <= -5.4e-22)
tmp = a * (t * (-4.0 / c));
elseif (b <= -3.8e-264)
tmp = t_2;
elseif (b <= 5.2e-89)
tmp = -4.0 * ((1.0 / c) * (t * a));
elseif (b <= 9.5e+67)
tmp = t_2;
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[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(y * N[(x / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.2e+36], t$95$1, If[LessEqual[b, -5.4e-22], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.8e-264], t$95$2, If[LessEqual[b, 5.2e-89], N[(-4.0 * N[(N[(1.0 / c), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.5e+67], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{1}{z}}{\frac{c}{b}}\\
t_2 := 9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right)\\
\mathbf{if}\;b \leq -2.2 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -5.4 \cdot 10^{-22}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-264}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-89}:\\
\;\;\;\;-4 \cdot \left(\frac{1}{c} \cdot \left(t \cdot a\right)\right)\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -2.2e36 or 9.5000000000000002e67 < b Initial program 84.0%
associate-+l-84.0%
div-sub78.3%
*-commutative78.3%
associate-*r*76.3%
*-commutative76.3%
div-sub82.0%
associate-+l-82.0%
Simplified82.3%
sub-neg82.3%
associate-+l+82.3%
distribute-lft-neg-in82.3%
*-commutative82.3%
associate-*r*82.0%
distribute-rgt-neg-in82.0%
metadata-eval82.0%
associate-*r*82.0%
*-commutative82.0%
*-commutative82.0%
+-commutative82.0%
*-un-lft-identity82.0%
fma-udef82.1%
Applied egg-rr83.4%
clear-num83.3%
un-div-inv83.9%
Applied egg-rr83.9%
Taylor expanded in b around inf 61.5%
if -2.2e36 < b < -5.4000000000000004e-22Initial program 79.8%
associate-+l-79.8%
div-sub74.8%
*-commutative74.8%
associate-*r*74.9%
*-commutative74.9%
div-sub79.9%
associate-+l-79.9%
Simplified79.9%
sub-neg79.9%
associate-+l+79.9%
distribute-lft-neg-in79.9%
*-commutative79.9%
associate-*r*79.9%
distribute-rgt-neg-in79.9%
metadata-eval79.9%
associate-*r*79.9%
*-commutative79.9%
*-commutative79.9%
+-commutative79.9%
*-un-lft-identity79.9%
fma-udef79.9%
Applied egg-rr80.5%
Taylor expanded in z around inf 70.3%
associate-*l/62.8%
*-commutative62.8%
Simplified62.8%
*-commutative62.8%
associate-*r/70.3%
associate-*l/70.3%
Applied egg-rr70.3%
Taylor expanded in t around 0 70.3%
associate-/l*75.1%
associate-*r/75.1%
*-commutative75.1%
associate-/l*70.3%
associate-*l/62.8%
associate-*r/62.8%
metadata-eval62.8%
associate-*r/62.8%
associate-*l*75.1%
associate-*r/75.1%
metadata-eval75.1%
Simplified75.1%
if -5.4000000000000004e-22 < b < -3.80000000000000013e-264 or 5.1999999999999997e-89 < b < 9.5000000000000002e67Initial program 84.7%
associate-+l-84.7%
div-sub72.8%
*-commutative72.8%
associate-*r*72.8%
*-commutative72.8%
div-sub84.7%
associate-+l-84.7%
Simplified83.6%
Taylor expanded in x around inf 58.5%
associate-/l*61.9%
associate-/r/56.4%
*-commutative56.4%
Applied egg-rr56.4%
if -3.80000000000000013e-264 < b < 5.1999999999999997e-89Initial program 75.5%
associate-+l-75.5%
div-sub69.1%
*-commutative69.1%
associate-*r*72.6%
*-commutative72.6%
div-sub79.0%
associate-+l-79.0%
Simplified79.5%
sub-neg79.5%
associate-+l+79.5%
distribute-lft-neg-in79.5%
*-commutative79.5%
associate-*r*79.0%
distribute-rgt-neg-in79.0%
metadata-eval79.0%
associate-*r*79.0%
*-commutative79.0%
*-commutative79.0%
+-commutative79.0%
*-un-lft-identity79.0%
fma-udef79.0%
Applied egg-rr83.2%
Taylor expanded in z around inf 58.5%
associate-*l/58.5%
*-commutative58.5%
Simplified58.5%
associate-*r/58.5%
clear-num58.4%
Applied egg-rr58.4%
associate-/r/58.5%
*-commutative58.5%
Simplified58.5%
Final simplification60.4%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (/ 1.0 z) (/ c b))))
(if (<= b -4.5e+42)
t_1
(if (<= b -2.4e-22)
(* a (* t (/ -4.0 c)))
(if (<= b -1.75e-264)
(* 9.0 (* y (/ x (* z c))))
(if (<= b 2.3e-92)
(* -4.0 (* (/ 1.0 c) (* t a)))
(if (<= b 8e+66) (* 9.0 (/ x (/ (* z c) y))) 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 = (1.0 / z) / (c / b);
double tmp;
if (b <= -4.5e+42) {
tmp = t_1;
} else if (b <= -2.4e-22) {
tmp = a * (t * (-4.0 / c));
} else if (b <= -1.75e-264) {
tmp = 9.0 * (y * (x / (z * c)));
} else if (b <= 2.3e-92) {
tmp = -4.0 * ((1.0 / c) * (t * a));
} else if (b <= 8e+66) {
tmp = 9.0 * (x / ((z * c) / y));
} 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 = (1.0d0 / z) / (c / b)
if (b <= (-4.5d+42)) then
tmp = t_1
else if (b <= (-2.4d-22)) then
tmp = a * (t * ((-4.0d0) / c))
else if (b <= (-1.75d-264)) then
tmp = 9.0d0 * (y * (x / (z * c)))
else if (b <= 2.3d-92) then
tmp = (-4.0d0) * ((1.0d0 / c) * (t * a))
else if (b <= 8d+66) then
tmp = 9.0d0 * (x / ((z * c) / y))
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 = (1.0 / z) / (c / b);
double tmp;
if (b <= -4.5e+42) {
tmp = t_1;
} else if (b <= -2.4e-22) {
tmp = a * (t * (-4.0 / c));
} else if (b <= -1.75e-264) {
tmp = 9.0 * (y * (x / (z * c)));
} else if (b <= 2.3e-92) {
tmp = -4.0 * ((1.0 / c) * (t * a));
} else if (b <= 8e+66) {
tmp = 9.0 * (x / ((z * c) / y));
} 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 = (1.0 / z) / (c / b) tmp = 0 if b <= -4.5e+42: tmp = t_1 elif b <= -2.4e-22: tmp = a * (t * (-4.0 / c)) elif b <= -1.75e-264: tmp = 9.0 * (y * (x / (z * c))) elif b <= 2.3e-92: tmp = -4.0 * ((1.0 / c) * (t * a)) elif b <= 8e+66: tmp = 9.0 * (x / ((z * c) / y)) 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(1.0 / z) / Float64(c / b)) tmp = 0.0 if (b <= -4.5e+42) tmp = t_1; elseif (b <= -2.4e-22) tmp = Float64(a * Float64(t * Float64(-4.0 / c))); elseif (b <= -1.75e-264) tmp = Float64(9.0 * Float64(y * Float64(x / Float64(z * c)))); elseif (b <= 2.3e-92) tmp = Float64(-4.0 * Float64(Float64(1.0 / c) * Float64(t * a))); elseif (b <= 8e+66) tmp = Float64(9.0 * Float64(x / Float64(Float64(z * c) / y))); 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 = (1.0 / z) / (c / b);
tmp = 0.0;
if (b <= -4.5e+42)
tmp = t_1;
elseif (b <= -2.4e-22)
tmp = a * (t * (-4.0 / c));
elseif (b <= -1.75e-264)
tmp = 9.0 * (y * (x / (z * c)));
elseif (b <= 2.3e-92)
tmp = -4.0 * ((1.0 / c) * (t * a));
elseif (b <= 8e+66)
tmp = 9.0 * (x / ((z * c) / y));
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[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.5e+42], t$95$1, If[LessEqual[b, -2.4e-22], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.75e-264], N[(9.0 * N[(y * N[(x / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-92], N[(-4.0 * N[(N[(1.0 / c), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e+66], N[(9.0 * N[(x / N[(N[(z * c), $MachinePrecision] / y), $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 := \frac{\frac{1}{z}}{\frac{c}{b}}\\
\mathbf{if}\;b \leq -4.5 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -2.4 \cdot 10^{-22}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\mathbf{elif}\;b \leq -1.75 \cdot 10^{-264}:\\
\;\;\;\;9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-92}:\\
\;\;\;\;-4 \cdot \left(\frac{1}{c} \cdot \left(t \cdot a\right)\right)\\
\mathbf{elif}\;b \leq 8 \cdot 10^{+66}:\\
\;\;\;\;9 \cdot \frac{x}{\frac{z \cdot c}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -4.50000000000000012e42 or 7.99999999999999956e66 < b Initial program 84.0%
associate-+l-84.0%
div-sub78.3%
*-commutative78.3%
associate-*r*76.3%
*-commutative76.3%
div-sub82.0%
associate-+l-82.0%
Simplified82.3%
sub-neg82.3%
associate-+l+82.3%
distribute-lft-neg-in82.3%
*-commutative82.3%
associate-*r*82.0%
distribute-rgt-neg-in82.0%
metadata-eval82.0%
associate-*r*82.0%
*-commutative82.0%
*-commutative82.0%
+-commutative82.0%
*-un-lft-identity82.0%
fma-udef82.1%
Applied egg-rr83.4%
clear-num83.3%
un-div-inv83.9%
Applied egg-rr83.9%
Taylor expanded in b around inf 61.5%
if -4.50000000000000012e42 < b < -2.40000000000000002e-22Initial program 79.8%
associate-+l-79.8%
div-sub74.8%
*-commutative74.8%
associate-*r*74.9%
*-commutative74.9%
div-sub79.9%
associate-+l-79.9%
Simplified79.9%
sub-neg79.9%
associate-+l+79.9%
distribute-lft-neg-in79.9%
*-commutative79.9%
associate-*r*79.9%
distribute-rgt-neg-in79.9%
metadata-eval79.9%
associate-*r*79.9%
*-commutative79.9%
*-commutative79.9%
+-commutative79.9%
*-un-lft-identity79.9%
fma-udef79.9%
Applied egg-rr80.5%
Taylor expanded in z around inf 70.3%
associate-*l/62.8%
*-commutative62.8%
Simplified62.8%
*-commutative62.8%
associate-*r/70.3%
associate-*l/70.3%
Applied egg-rr70.3%
Taylor expanded in t around 0 70.3%
associate-/l*75.1%
associate-*r/75.1%
*-commutative75.1%
associate-/l*70.3%
associate-*l/62.8%
associate-*r/62.8%
metadata-eval62.8%
associate-*r/62.8%
associate-*l*75.1%
associate-*r/75.1%
metadata-eval75.1%
Simplified75.1%
if -2.40000000000000002e-22 < b < -1.75e-264Initial program 77.6%
associate-+l-77.6%
div-sub67.1%
*-commutative67.1%
associate-*r*67.2%
*-commutative67.2%
div-sub77.7%
associate-+l-77.7%
Simplified75.9%
Taylor expanded in x around inf 57.7%
associate-/l*61.1%
associate-/r/56.3%
*-commutative56.3%
Applied egg-rr56.3%
if -1.75e-264 < b < 2.30000000000000016e-92Initial program 75.5%
associate-+l-75.5%
div-sub69.1%
*-commutative69.1%
associate-*r*72.6%
*-commutative72.6%
div-sub79.0%
associate-+l-79.0%
Simplified79.5%
sub-neg79.5%
associate-+l+79.5%
distribute-lft-neg-in79.5%
*-commutative79.5%
associate-*r*79.0%
distribute-rgt-neg-in79.0%
metadata-eval79.0%
associate-*r*79.0%
*-commutative79.0%
*-commutative79.0%
+-commutative79.0%
*-un-lft-identity79.0%
fma-udef79.0%
Applied egg-rr83.2%
Taylor expanded in z around inf 58.5%
associate-*l/58.5%
*-commutative58.5%
Simplified58.5%
associate-*r/58.5%
clear-num58.4%
Applied egg-rr58.4%
associate-/r/58.5%
*-commutative58.5%
Simplified58.5%
if 2.30000000000000016e-92 < b < 7.99999999999999956e66Initial program 99.6%
associate-+l-99.6%
div-sub84.8%
*-commutative84.8%
associate-*r*84.8%
*-commutative84.8%
div-sub99.6%
associate-+l-99.6%
Simplified99.8%
Taylor expanded in x around inf 60.1%
*-commutative60.1%
associate-/l*63.6%
Simplified63.6%
Final simplification61.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
(let* ((t_1 (/ (/ 1.0 z) (/ c b))))
(if (<= b -4.1e+42)
t_1
(if (<= b -1.32e-18)
(* a (* t (/ -4.0 c)))
(if (<= b -4.9e-265)
(* (/ y (/ c x)) (/ 9.0 z))
(if (<= b 4e-86)
(* -4.0 (* (/ 1.0 c) (* t a)))
(if (<= b 1.05e+69) (* 9.0 (/ x (/ (* z c) y))) 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 = (1.0 / z) / (c / b);
double tmp;
if (b <= -4.1e+42) {
tmp = t_1;
} else if (b <= -1.32e-18) {
tmp = a * (t * (-4.0 / c));
} else if (b <= -4.9e-265) {
tmp = (y / (c / x)) * (9.0 / z);
} else if (b <= 4e-86) {
tmp = -4.0 * ((1.0 / c) * (t * a));
} else if (b <= 1.05e+69) {
tmp = 9.0 * (x / ((z * c) / y));
} 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 = (1.0d0 / z) / (c / b)
if (b <= (-4.1d+42)) then
tmp = t_1
else if (b <= (-1.32d-18)) then
tmp = a * (t * ((-4.0d0) / c))
else if (b <= (-4.9d-265)) then
tmp = (y / (c / x)) * (9.0d0 / z)
else if (b <= 4d-86) then
tmp = (-4.0d0) * ((1.0d0 / c) * (t * a))
else if (b <= 1.05d+69) then
tmp = 9.0d0 * (x / ((z * c) / y))
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 = (1.0 / z) / (c / b);
double tmp;
if (b <= -4.1e+42) {
tmp = t_1;
} else if (b <= -1.32e-18) {
tmp = a * (t * (-4.0 / c));
} else if (b <= -4.9e-265) {
tmp = (y / (c / x)) * (9.0 / z);
} else if (b <= 4e-86) {
tmp = -4.0 * ((1.0 / c) * (t * a));
} else if (b <= 1.05e+69) {
tmp = 9.0 * (x / ((z * c) / y));
} 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 = (1.0 / z) / (c / b) tmp = 0 if b <= -4.1e+42: tmp = t_1 elif b <= -1.32e-18: tmp = a * (t * (-4.0 / c)) elif b <= -4.9e-265: tmp = (y / (c / x)) * (9.0 / z) elif b <= 4e-86: tmp = -4.0 * ((1.0 / c) * (t * a)) elif b <= 1.05e+69: tmp = 9.0 * (x / ((z * c) / y)) 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(1.0 / z) / Float64(c / b)) tmp = 0.0 if (b <= -4.1e+42) tmp = t_1; elseif (b <= -1.32e-18) tmp = Float64(a * Float64(t * Float64(-4.0 / c))); elseif (b <= -4.9e-265) tmp = Float64(Float64(y / Float64(c / x)) * Float64(9.0 / z)); elseif (b <= 4e-86) tmp = Float64(-4.0 * Float64(Float64(1.0 / c) * Float64(t * a))); elseif (b <= 1.05e+69) tmp = Float64(9.0 * Float64(x / Float64(Float64(z * c) / y))); 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 = (1.0 / z) / (c / b);
tmp = 0.0;
if (b <= -4.1e+42)
tmp = t_1;
elseif (b <= -1.32e-18)
tmp = a * (t * (-4.0 / c));
elseif (b <= -4.9e-265)
tmp = (y / (c / x)) * (9.0 / z);
elseif (b <= 4e-86)
tmp = -4.0 * ((1.0 / c) * (t * a));
elseif (b <= 1.05e+69)
tmp = 9.0 * (x / ((z * c) / y));
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[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.1e+42], t$95$1, If[LessEqual[b, -1.32e-18], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.9e-265], N[(N[(y / N[(c / x), $MachinePrecision]), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e-86], N[(-4.0 * N[(N[(1.0 / c), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e+69], N[(9.0 * N[(x / N[(N[(z * c), $MachinePrecision] / y), $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 := \frac{\frac{1}{z}}{\frac{c}{b}}\\
\mathbf{if}\;b \leq -4.1 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.32 \cdot 10^{-18}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\mathbf{elif}\;b \leq -4.9 \cdot 10^{-265}:\\
\;\;\;\;\frac{y}{\frac{c}{x}} \cdot \frac{9}{z}\\
\mathbf{elif}\;b \leq 4 \cdot 10^{-86}:\\
\;\;\;\;-4 \cdot \left(\frac{1}{c} \cdot \left(t \cdot a\right)\right)\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+69}:\\
\;\;\;\;9 \cdot \frac{x}{\frac{z \cdot c}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -4.1e42 or 1.05000000000000008e69 < b Initial program 84.0%
associate-+l-84.0%
div-sub78.3%
*-commutative78.3%
associate-*r*76.3%
*-commutative76.3%
div-sub82.0%
associate-+l-82.0%
Simplified82.3%
sub-neg82.3%
associate-+l+82.3%
distribute-lft-neg-in82.3%
*-commutative82.3%
associate-*r*82.0%
distribute-rgt-neg-in82.0%
metadata-eval82.0%
associate-*r*82.0%
*-commutative82.0%
*-commutative82.0%
+-commutative82.0%
*-un-lft-identity82.0%
fma-udef82.1%
Applied egg-rr83.4%
clear-num83.3%
un-div-inv83.9%
Applied egg-rr83.9%
Taylor expanded in b around inf 61.5%
if -4.1e42 < b < -1.3199999999999999e-18Initial program 78.8%
associate-+l-78.8%
div-sub73.5%
*-commutative73.5%
associate-*r*73.6%
*-commutative73.6%
div-sub78.9%
associate-+l-78.9%
Simplified78.9%
sub-neg78.9%
associate-+l+78.9%
distribute-lft-neg-in78.9%
*-commutative78.9%
associate-*r*78.9%
distribute-rgt-neg-in78.9%
metadata-eval78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
+-commutative78.9%
*-un-lft-identity78.9%
fma-udef78.9%
Applied egg-rr79.5%
Taylor expanded in z around inf 68.8%
associate-*l/60.8%
*-commutative60.8%
Simplified60.8%
*-commutative60.8%
associate-*r/68.8%
associate-*l/68.8%
Applied egg-rr68.8%
Taylor expanded in t around 0 68.8%
associate-/l*73.8%
associate-*r/73.8%
*-commutative73.8%
associate-/l*68.8%
associate-*l/60.8%
associate-*r/60.8%
metadata-eval60.8%
associate-*r/60.8%
associate-*l*73.8%
associate-*r/73.8%
metadata-eval73.8%
Simplified73.8%
if -1.3199999999999999e-18 < b < -4.89999999999999999e-265Initial program 78.0%
associate-+l-78.0%
div-sub67.6%
*-commutative67.6%
associate-*r*67.7%
*-commutative67.7%
div-sub78.1%
associate-+l-78.1%
Simplified76.4%
Taylor expanded in x around inf 58.4%
*-commutative58.4%
associate-*r/58.4%
*-commutative58.4%
*-commutative58.4%
times-frac58.6%
*-commutative58.6%
associate-/l*57.9%
Simplified57.9%
if -4.89999999999999999e-265 < b < 4.00000000000000034e-86Initial program 75.5%
associate-+l-75.5%
div-sub69.1%
*-commutative69.1%
associate-*r*72.6%
*-commutative72.6%
div-sub79.0%
associate-+l-79.0%
Simplified79.5%
sub-neg79.5%
associate-+l+79.5%
distribute-lft-neg-in79.5%
*-commutative79.5%
associate-*r*79.0%
distribute-rgt-neg-in79.0%
metadata-eval79.0%
associate-*r*79.0%
*-commutative79.0%
*-commutative79.0%
+-commutative79.0%
*-un-lft-identity79.0%
fma-udef79.0%
Applied egg-rr83.2%
Taylor expanded in z around inf 58.5%
associate-*l/58.5%
*-commutative58.5%
Simplified58.5%
associate-*r/58.5%
clear-num58.4%
Applied egg-rr58.4%
associate-/r/58.5%
*-commutative58.5%
Simplified58.5%
if 4.00000000000000034e-86 < b < 1.05000000000000008e69Initial program 99.6%
associate-+l-99.6%
div-sub84.8%
*-commutative84.8%
associate-*r*84.8%
*-commutative84.8%
div-sub99.6%
associate-+l-99.6%
Simplified99.8%
Taylor expanded in x around inf 60.1%
*-commutative60.1%
associate-/l*63.6%
Simplified63.6%
Final simplification61.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= a -2.8e+73)
(not
(or (<= a 1.06e+101) (and (not (<= a 8.3e+204)) (<= a 1.6e+219)))))
(/ (* t -4.0) (/ c a))
(/ (+ b (* 9.0 (* x y))) (* z c))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -2.8e+73) || !((a <= 1.06e+101) || (!(a <= 8.3e+204) && (a <= 1.6e+219)))) {
tmp = (t * -4.0) / (c / a);
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a <= (-2.8d+73)) .or. (.not. (a <= 1.06d+101) .or. (.not. (a <= 8.3d+204)) .and. (a <= 1.6d+219))) then
tmp = (t * (-4.0d0)) / (c / a)
else
tmp = (b + (9.0d0 * (x * y))) / (z * c)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -2.8e+73) || !((a <= 1.06e+101) || (!(a <= 8.3e+204) && (a <= 1.6e+219)))) {
tmp = (t * -4.0) / (c / a);
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -2.8e+73) or not ((a <= 1.06e+101) or (not (a <= 8.3e+204) and (a <= 1.6e+219))): tmp = (t * -4.0) / (c / a) else: tmp = (b + (9.0 * (x * y))) / (z * c) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -2.8e+73) || !((a <= 1.06e+101) || (!(a <= 8.3e+204) && (a <= 1.6e+219)))) tmp = Float64(Float64(t * -4.0) / Float64(c / a)); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(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 <= -2.8e+73) || ~(((a <= 1.06e+101) || (~((a <= 8.3e+204)) && (a <= 1.6e+219)))))
tmp = (t * -4.0) / (c / a);
else
tmp = (b + (9.0 * (x * y))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -2.8e+73], N[Not[Or[LessEqual[a, 1.06e+101], And[N[Not[LessEqual[a, 8.3e+204]], $MachinePrecision], LessEqual[a, 1.6e+219]]]], $MachinePrecision]], N[(N[(t * -4.0), $MachinePrecision] / N[(c / a), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{+73} \lor \neg \left(a \leq 1.06 \cdot 10^{+101} \lor \neg \left(a \leq 8.3 \cdot 10^{+204}\right) \land a \leq 1.6 \cdot 10^{+219}\right):\\
\;\;\;\;\frac{t \cdot -4}{\frac{c}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
\end{array}
if a < -2.80000000000000008e73 or 1.06e101 < a < 8.3000000000000004e204 or 1.60000000000000013e219 < a Initial program 81.3%
associate-+l-81.3%
div-sub77.0%
*-commutative77.0%
associate-*r*75.5%
*-commutative75.5%
div-sub79.8%
associate-+l-79.8%
Simplified78.1%
sub-neg78.1%
associate-+l+78.1%
distribute-lft-neg-in78.1%
*-commutative78.1%
associate-*r*79.8%
distribute-rgt-neg-in79.8%
metadata-eval79.8%
associate-*r*79.8%
*-commutative79.8%
*-commutative79.8%
+-commutative79.8%
*-un-lft-identity79.8%
fma-udef79.9%
Applied egg-rr82.2%
Taylor expanded in z around inf 55.1%
associate-*l/61.2%
*-commutative61.2%
Simplified61.2%
associate-*r*61.2%
clear-num61.2%
un-div-inv61.5%
*-commutative61.5%
Applied egg-rr61.5%
if -2.80000000000000008e73 < a < 1.06e101 or 8.3000000000000004e204 < a < 1.60000000000000013e219Initial program 83.0%
associate-+l-83.0%
div-sub73.1%
*-commutative73.1%
associate-*r*73.7%
*-commutative73.7%
div-sub83.6%
associate-+l-83.6%
Simplified84.2%
Taylor expanded in x around inf 73.8%
Final simplification69.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 (/ (+ b (* 9.0 (* x y))) (* z c))) (t_2 (/ (* t -4.0) (/ c a))))
(if (<= a -1.46e+72)
t_2
(if (<= a 8e+100)
t_1
(if (<= a 1.95e+206)
(+ (/ b (* z c)) (* -4.0 (/ (* t a) c)))
(if (<= a 1.6e+219) 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))) / (z * c);
double t_2 = (t * -4.0) / (c / a);
double tmp;
if (a <= -1.46e+72) {
tmp = t_2;
} else if (a <= 8e+100) {
tmp = t_1;
} else if (a <= 1.95e+206) {
tmp = (b / (z * c)) + (-4.0 * ((t * a) / c));
} else if (a <= 1.6e+219) {
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))) / (z * c)
t_2 = (t * (-4.0d0)) / (c / a)
if (a <= (-1.46d+72)) then
tmp = t_2
else if (a <= 8d+100) then
tmp = t_1
else if (a <= 1.95d+206) then
tmp = (b / (z * c)) + ((-4.0d0) * ((t * a) / c))
else if (a <= 1.6d+219) 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))) / (z * c);
double t_2 = (t * -4.0) / (c / a);
double tmp;
if (a <= -1.46e+72) {
tmp = t_2;
} else if (a <= 8e+100) {
tmp = t_1;
} else if (a <= 1.95e+206) {
tmp = (b / (z * c)) + (-4.0 * ((t * a) / c));
} else if (a <= 1.6e+219) {
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))) / (z * c) t_2 = (t * -4.0) / (c / a) tmp = 0 if a <= -1.46e+72: tmp = t_2 elif a <= 8e+100: tmp = t_1 elif a <= 1.95e+206: tmp = (b / (z * c)) + (-4.0 * ((t * a) / c)) elif a <= 1.6e+219: 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(z * c)) t_2 = Float64(Float64(t * -4.0) / Float64(c / a)) tmp = 0.0 if (a <= -1.46e+72) tmp = t_2; elseif (a <= 8e+100) tmp = t_1; elseif (a <= 1.95e+206) tmp = Float64(Float64(b / Float64(z * c)) + Float64(-4.0 * Float64(Float64(t * a) / c))); elseif (a <= 1.6e+219) 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))) / (z * c);
t_2 = (t * -4.0) / (c / a);
tmp = 0.0;
if (a <= -1.46e+72)
tmp = t_2;
elseif (a <= 8e+100)
tmp = t_1;
elseif (a <= 1.95e+206)
tmp = (b / (z * c)) + (-4.0 * ((t * a) / c));
elseif (a <= 1.6e+219)
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[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * -4.0), $MachinePrecision] / N[(c / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.46e+72], t$95$2, If[LessEqual[a, 8e+100], t$95$1, If[LessEqual[a, 1.95e+206], N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+219], 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)}{z \cdot c}\\
t_2 := \frac{t \cdot -4}{\frac{c}{a}}\\
\mathbf{if}\;a \leq -1.46 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+206}:\\
\;\;\;\;\frac{b}{z \cdot c} + -4 \cdot \frac{t \cdot a}{c}\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+219}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -1.45999999999999999e72 or 1.60000000000000013e219 < a Initial program 81.7%
associate-+l-81.7%
div-sub75.9%
*-commutative75.9%
associate-*r*74.2%
*-commutative74.2%
div-sub80.0%
associate-+l-80.0%
Simplified77.5%
sub-neg77.5%
associate-+l+77.5%
distribute-lft-neg-in77.5%
*-commutative77.5%
associate-*r*79.9%
distribute-rgt-neg-in79.9%
metadata-eval79.9%
associate-*r*79.9%
*-commutative79.9%
*-commutative79.9%
+-commutative79.9%
*-un-lft-identity79.9%
fma-udef80.0%
Applied egg-rr81.7%
Taylor expanded in z around inf 54.7%
associate-*l/63.0%
*-commutative63.0%
Simplified63.0%
associate-*r*63.0%
clear-num62.9%
un-div-inv63.3%
*-commutative63.3%
Applied egg-rr63.3%
if -1.45999999999999999e72 < a < 8.00000000000000013e100 or 1.95e206 < a < 1.60000000000000013e219Initial program 83.0%
associate-+l-83.0%
div-sub73.1%
*-commutative73.1%
associate-*r*73.7%
*-commutative73.7%
div-sub83.6%
associate-+l-83.6%
Simplified84.2%
Taylor expanded in x around inf 73.8%
if 8.00000000000000013e100 < a < 1.95e206Initial program 80.1%
associate-+l-80.1%
div-sub80.1%
*-commutative80.1%
associate-*r*79.5%
*-commutative79.5%
div-sub79.5%
associate-+l-79.5%
Simplified80.1%
Taylor expanded in x around 0 76.3%
Taylor expanded in b around 0 87.8%
Final simplification72.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= a -3.8e-80) (not (<= a 4.8e-10))) (* -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 <= -3.8e-80) || !(a <= 4.8e-10)) {
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 <= (-3.8d-80)) .or. (.not. (a <= 4.8d-10))) 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 <= -3.8e-80) || !(a <= 4.8e-10)) {
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 <= -3.8e-80) or not (a <= 4.8e-10): 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 <= -3.8e-80) || !(a <= 4.8e-10)) 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])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((a <= -3.8e-80) || ~((a <= 4.8e-10)))
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, -3.8e-80], N[Not[LessEqual[a, 4.8e-10]], $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])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-80} \lor \neg \left(a \leq 4.8 \cdot 10^{-10}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if a < -3.79999999999999967e-80 or 4.8e-10 < a Initial program 80.6%
associate-+l-80.6%
div-sub73.3%
*-commutative73.3%
associate-*r*71.1%
*-commutative71.1%
div-sub78.3%
associate-+l-78.3%
Simplified78.0%
sub-neg78.0%
associate-+l+78.0%
distribute-lft-neg-in78.0%
*-commutative78.0%
associate-*r*78.3%
distribute-rgt-neg-in78.3%
metadata-eval78.3%
associate-*r*78.3%
*-commutative78.3%
*-commutative78.3%
+-commutative78.3%
*-un-lft-identity78.3%
fma-udef78.4%
Applied egg-rr79.4%
Taylor expanded in z around inf 48.5%
associate-*l/51.9%
*-commutative51.9%
Simplified51.9%
if -3.79999999999999967e-80 < a < 4.8e-10Initial program 84.9%
associate-+l-84.9%
div-sub76.3%
*-commutative76.3%
associate-*r*79.2%
*-commutative79.2%
div-sub87.8%
associate-+l-87.8%
Simplified87.8%
Taylor expanded in b around inf 46.3%
*-commutative46.3%
Simplified46.3%
Final simplification49.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 (<= a -7.8e-75) (* a (* t (/ -4.0 c))) (if (<= a 1.52e-10) (/ b (* z c)) (* -4.0 (* t (/ a 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 <= -7.8e-75) {
tmp = a * (t * (-4.0 / c));
} else if (a <= 1.52e-10) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t * (a / 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 <= (-7.8d-75)) then
tmp = a * (t * ((-4.0d0) / c))
else if (a <= 1.52d-10) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * (t * (a / 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 <= -7.8e-75) {
tmp = a * (t * (-4.0 / c));
} else if (a <= 1.52e-10) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t * (a / 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 <= -7.8e-75: tmp = a * (t * (-4.0 / c)) elif a <= 1.52e-10: tmp = b / (z * c) else: tmp = -4.0 * (t * (a / 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 <= -7.8e-75) tmp = Float64(a * Float64(t * Float64(-4.0 / c))); elseif (a <= 1.52e-10) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t * Float64(a / 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 <= -7.8e-75)
tmp = a * (t * (-4.0 / c));
elseif (a <= 1.52e-10)
tmp = b / (z * c);
else
tmp = -4.0 * (t * (a / 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[a, -7.8e-75], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.52e-10], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-75}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{-10}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if a < -7.8000000000000003e-75Initial program 82.1%
associate-+l-82.1%
div-sub76.1%
*-commutative76.1%
associate-*r*73.5%
*-commutative73.5%
div-sub79.5%
associate-+l-79.5%
Simplified81.0%
sub-neg81.0%
associate-+l+81.0%
distribute-lft-neg-in81.0%
*-commutative81.0%
associate-*r*79.5%
distribute-rgt-neg-in79.5%
metadata-eval79.5%
associate-*r*79.5%
*-commutative79.5%
*-commutative79.5%
+-commutative79.5%
*-un-lft-identity79.5%
fma-udef79.6%
Applied egg-rr81.1%
Taylor expanded in z around inf 48.1%
associate-*l/49.7%
*-commutative49.7%
Simplified49.7%
*-commutative49.7%
associate-*r/48.1%
associate-*l/48.1%
Applied egg-rr48.1%
Taylor expanded in t around 0 48.1%
associate-/l*51.7%
associate-*r/51.7%
*-commutative51.7%
associate-/l*48.1%
associate-*l/49.7%
associate-*r/49.7%
metadata-eval49.7%
associate-*r/49.7%
associate-*l*51.6%
associate-*r/51.6%
metadata-eval51.6%
Simplified51.6%
if -7.8000000000000003e-75 < a < 1.5199999999999999e-10Initial program 85.1%
associate-+l-85.1%
div-sub76.6%
*-commutative76.6%
associate-*r*79.4%
*-commutative79.4%
div-sub87.9%
associate-+l-87.9%
Simplified87.9%
Taylor expanded in b around inf 45.9%
*-commutative45.9%
Simplified45.9%
if 1.5199999999999999e-10 < a Initial program 78.3%
associate-+l-78.3%
div-sub69.3%
*-commutative69.3%
associate-*r*67.6%
*-commutative67.6%
div-sub76.6%
associate-+l-76.6%
Simplified74.0%
sub-neg74.0%
associate-+l+74.0%
distribute-lft-neg-in74.0%
*-commutative74.0%
associate-*r*76.6%
distribute-rgt-neg-in76.6%
metadata-eval76.6%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
+-commutative76.6%
*-un-lft-identity76.6%
fma-udef76.6%
Applied egg-rr76.9%
Taylor expanded in z around inf 48.1%
associate-*l/53.9%
*-commutative53.9%
Simplified53.9%
Final simplification49.8%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= a -8.5e-78) (* a (* t (/ -4.0 c))) (if (<= a 3.9e-10) (* b (/ (/ 1.0 c) z)) (* -4.0 (* t (/ a 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 <= -8.5e-78) {
tmp = a * (t * (-4.0 / c));
} else if (a <= 3.9e-10) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = -4.0 * (t * (a / 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 <= (-8.5d-78)) then
tmp = a * (t * ((-4.0d0) / c))
else if (a <= 3.9d-10) then
tmp = b * ((1.0d0 / c) / z)
else
tmp = (-4.0d0) * (t * (a / 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 <= -8.5e-78) {
tmp = a * (t * (-4.0 / c));
} else if (a <= 3.9e-10) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = -4.0 * (t * (a / 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 <= -8.5e-78: tmp = a * (t * (-4.0 / c)) elif a <= 3.9e-10: tmp = b * ((1.0 / c) / z) else: tmp = -4.0 * (t * (a / 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 <= -8.5e-78) tmp = Float64(a * Float64(t * Float64(-4.0 / c))); elseif (a <= 3.9e-10) tmp = Float64(b * Float64(Float64(1.0 / c) / z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / 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 <= -8.5e-78)
tmp = a * (t * (-4.0 / c));
elseif (a <= 3.9e-10)
tmp = b * ((1.0 / c) / z);
else
tmp = -4.0 * (t * (a / 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[a, -8.5e-78], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.9e-10], N[(b * N[(N[(1.0 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-78}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{-10}:\\
\;\;\;\;b \cdot \frac{\frac{1}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if a < -8.49999999999999957e-78Initial program 82.1%
associate-+l-82.1%
div-sub76.1%
*-commutative76.1%
associate-*r*73.5%
*-commutative73.5%
div-sub79.5%
associate-+l-79.5%
Simplified81.0%
sub-neg81.0%
associate-+l+81.0%
distribute-lft-neg-in81.0%
*-commutative81.0%
associate-*r*79.5%
distribute-rgt-neg-in79.5%
metadata-eval79.5%
associate-*r*79.5%
*-commutative79.5%
*-commutative79.5%
+-commutative79.5%
*-un-lft-identity79.5%
fma-udef79.6%
Applied egg-rr81.1%
Taylor expanded in z around inf 48.1%
associate-*l/49.7%
*-commutative49.7%
Simplified49.7%
*-commutative49.7%
associate-*r/48.1%
associate-*l/48.1%
Applied egg-rr48.1%
Taylor expanded in t around 0 48.1%
associate-/l*51.7%
associate-*r/51.7%
*-commutative51.7%
associate-/l*48.1%
associate-*l/49.7%
associate-*r/49.7%
metadata-eval49.7%
associate-*r/49.7%
associate-*l*51.6%
associate-*r/51.6%
metadata-eval51.6%
Simplified51.6%
if -8.49999999999999957e-78 < a < 3.9e-10Initial program 85.1%
associate-+l-85.1%
div-sub76.6%
*-commutative76.6%
associate-*r*79.4%
*-commutative79.4%
div-sub87.9%
associate-+l-87.9%
Simplified87.9%
sub-neg87.9%
associate-+l+87.9%
distribute-lft-neg-in87.9%
*-commutative87.9%
associate-*r*87.9%
distribute-rgt-neg-in87.9%
metadata-eval87.9%
associate-*r*87.9%
*-commutative87.9%
*-commutative87.9%
+-commutative87.9%
*-un-lft-identity87.9%
fma-udef87.9%
Applied egg-rr89.8%
clear-num89.7%
un-div-inv90.3%
Applied egg-rr90.3%
Taylor expanded in b around inf 45.9%
associate-/l/44.0%
Simplified44.0%
associate-/r*45.9%
div-inv46.7%
*-commutative46.7%
associate-/r*46.8%
Applied egg-rr46.8%
if 3.9e-10 < a Initial program 78.3%
associate-+l-78.3%
div-sub69.3%
*-commutative69.3%
associate-*r*67.6%
*-commutative67.6%
div-sub76.6%
associate-+l-76.6%
Simplified74.0%
sub-neg74.0%
associate-+l+74.0%
distribute-lft-neg-in74.0%
*-commutative74.0%
associate-*r*76.6%
distribute-rgt-neg-in76.6%
metadata-eval76.6%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
+-commutative76.6%
*-un-lft-identity76.6%
fma-udef76.6%
Applied egg-rr76.9%
Taylor expanded in z around inf 48.1%
associate-*l/53.9%
*-commutative53.9%
Simplified53.9%
Final simplification50.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 (if (<= a -1.9e-75) (* a (* t (/ -4.0 c))) (if (<= a 2.25e-10) (* b (/ (/ 1.0 c) z)) (/ (* t -4.0) (/ c a)))))
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.9e-75) {
tmp = a * (t * (-4.0 / c));
} else if (a <= 2.25e-10) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = (t * -4.0) / (c / a);
}
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.9d-75)) then
tmp = a * (t * ((-4.0d0) / c))
else if (a <= 2.25d-10) then
tmp = b * ((1.0d0 / c) / z)
else
tmp = (t * (-4.0d0)) / (c / a)
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.9e-75) {
tmp = a * (t * (-4.0 / c));
} else if (a <= 2.25e-10) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = (t * -4.0) / (c / a);
}
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.9e-75: tmp = a * (t * (-4.0 / c)) elif a <= 2.25e-10: tmp = b * ((1.0 / c) / z) else: tmp = (t * -4.0) / (c / a) 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.9e-75) tmp = Float64(a * Float64(t * Float64(-4.0 / c))); elseif (a <= 2.25e-10) tmp = Float64(b * Float64(Float64(1.0 / c) / z)); else tmp = Float64(Float64(t * -4.0) / Float64(c / a)); 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.9e-75)
tmp = a * (t * (-4.0 / c));
elseif (a <= 2.25e-10)
tmp = b * ((1.0 / c) / z);
else
tmp = (t * -4.0) / (c / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, -1.9e-75], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.25e-10], N[(b * N[(N[(1.0 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(t * -4.0), $MachinePrecision] / N[(c / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-75}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-10}:\\
\;\;\;\;b \cdot \frac{\frac{1}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot -4}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -1.89999999999999997e-75Initial program 82.1%
associate-+l-82.1%
div-sub76.1%
*-commutative76.1%
associate-*r*73.5%
*-commutative73.5%
div-sub79.5%
associate-+l-79.5%
Simplified81.0%
sub-neg81.0%
associate-+l+81.0%
distribute-lft-neg-in81.0%
*-commutative81.0%
associate-*r*79.5%
distribute-rgt-neg-in79.5%
metadata-eval79.5%
associate-*r*79.5%
*-commutative79.5%
*-commutative79.5%
+-commutative79.5%
*-un-lft-identity79.5%
fma-udef79.6%
Applied egg-rr81.1%
Taylor expanded in z around inf 48.1%
associate-*l/49.7%
*-commutative49.7%
Simplified49.7%
*-commutative49.7%
associate-*r/48.1%
associate-*l/48.1%
Applied egg-rr48.1%
Taylor expanded in t around 0 48.1%
associate-/l*51.7%
associate-*r/51.7%
*-commutative51.7%
associate-/l*48.1%
associate-*l/49.7%
associate-*r/49.7%
metadata-eval49.7%
associate-*r/49.7%
associate-*l*51.6%
associate-*r/51.6%
metadata-eval51.6%
Simplified51.6%
if -1.89999999999999997e-75 < a < 2.25e-10Initial program 85.1%
associate-+l-85.1%
div-sub76.6%
*-commutative76.6%
associate-*r*79.4%
*-commutative79.4%
div-sub87.9%
associate-+l-87.9%
Simplified87.9%
sub-neg87.9%
associate-+l+87.9%
distribute-lft-neg-in87.9%
*-commutative87.9%
associate-*r*87.9%
distribute-rgt-neg-in87.9%
metadata-eval87.9%
associate-*r*87.9%
*-commutative87.9%
*-commutative87.9%
+-commutative87.9%
*-un-lft-identity87.9%
fma-udef87.9%
Applied egg-rr89.8%
clear-num89.7%
un-div-inv90.3%
Applied egg-rr90.3%
Taylor expanded in b around inf 45.9%
associate-/l/44.0%
Simplified44.0%
associate-/r*45.9%
div-inv46.7%
*-commutative46.7%
associate-/r*46.8%
Applied egg-rr46.8%
if 2.25e-10 < a Initial program 78.3%
associate-+l-78.3%
div-sub69.3%
*-commutative69.3%
associate-*r*67.6%
*-commutative67.6%
div-sub76.6%
associate-+l-76.6%
Simplified74.0%
sub-neg74.0%
associate-+l+74.0%
distribute-lft-neg-in74.0%
*-commutative74.0%
associate-*r*76.6%
distribute-rgt-neg-in76.6%
metadata-eval76.6%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
+-commutative76.6%
*-un-lft-identity76.6%
fma-udef76.6%
Applied egg-rr76.9%
Taylor expanded in z around inf 48.1%
associate-*l/53.9%
*-commutative53.9%
Simplified53.9%
associate-*r*53.9%
clear-num53.8%
un-div-inv53.9%
*-commutative53.9%
Applied egg-rr53.9%
Final simplification50.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 (if (<= y 1.9e-210) (/ (/ b c) z) (/ 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 (y <= 1.9e-210) {
tmp = (b / c) / z;
} 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 (y <= 1.9d-210) then
tmp = (b / c) / z
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 (y <= 1.9e-210) {
tmp = (b / c) / z;
} 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 y <= 1.9e-210: tmp = (b / c) / z 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 (y <= 1.9e-210) tmp = Float64(Float64(b / c) / z); else tmp = Float64(b / Float64(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 (y <= 1.9e-210)
tmp = (b / c) / z;
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[LessEqual[y, 1.9e-210], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{-210}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if y < 1.90000000000000002e-210Initial program 85.6%
associate-+l-85.6%
div-sub78.0%
*-commutative78.0%
associate-*r*77.8%
*-commutative77.8%
div-sub85.4%
associate-+l-85.4%
Simplified84.4%
Taylor expanded in x around inf 64.2%
associate-*r*64.2%
Simplified64.2%
Taylor expanded in x around 0 38.5%
associate-/r*39.8%
Simplified39.8%
if 1.90000000000000002e-210 < y Initial program 78.1%
associate-+l-78.1%
div-sub70.1%
*-commutative70.1%
associate-*r*70.0%
*-commutative70.0%
div-sub78.1%
associate-+l-78.1%
Simplified79.0%
Taylor expanded in b around inf 34.3%
*-commutative34.3%
Simplified34.3%
Final simplification37.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ 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) {
return b / (z * c);
}
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 / (z * c)
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 / (z * c);
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) 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 / (z * c);
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[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 82.3%
associate-+l-82.3%
div-sub74.5%
*-commutative74.5%
associate-*r*74.4%
*-commutative74.4%
div-sub82.2%
associate-+l-82.2%
Simplified82.0%
Taylor expanded in b around inf 36.6%
*-commutative36.6%
Simplified36.6%
Final simplification36.6%
(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 2023301
(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)))