
(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 (/ (+ (- (* y (* x 9.0)) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -2e-32)
t_1
(if (<= t_1 0.0)
(* (/ (+ b (fma x (* 9.0 y) (* a (* z (* t (- 4.0)))))) z) (/ 1.0 c))
(if (<= t_1 INFINITY) t_1 (* (/ a (/ c t)) -4.0))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-32) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((b + fma(x, (9.0 * y), (a * (z * (t * -4.0))))) / z) * (1.0 / c);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
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(y * Float64(x * 9.0)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-32) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(a * Float64(z * Float64(t * Float64(-4.0)))))) / z) * Float64(1.0 / c)); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a / Float64(c / t)) * -4.0); 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[(y * N[(x * 9.0), $MachinePrecision]), $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-32], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(a * N[(z * N[(t * (-4.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{\left(y \cdot \left(x \cdot 9\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, 9 \cdot y, a \cdot \left(z \cdot \left(t \cdot \left(-4\right)\right)\right)\right)}{z} \cdot \frac{1}{c}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\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.00000000000000011e-32 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 89.4%
if -2.00000000000000011e-32 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -0.0Initial program 68.0%
associate-/r*99.7%
associate-+l-99.7%
associate-*r*99.6%
associate-*r*99.6%
div-inv99.7%
associate--r-99.7%
fma-neg99.7%
associate-*r*99.7%
distribute-rgt-neg-in99.7%
associate-*l*99.7%
Applied egg-rr99.7%
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%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
associate-/l*77.3%
Simplified77.3%
Final simplification89.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 (/ (+ (- (* y (* x 9.0)) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -2.0)
t_1
(if (<= t_1 2e-225)
(* (/ 1.0 z) (/ (+ b (fma x (* 9.0 y) (* a (* z (* t (- 4.0)))))) c))
(if (<= t_1 INFINITY) t_1 (* (/ a (/ c t)) -4.0))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2.0) {
tmp = t_1;
} else if (t_1 <= 2e-225) {
tmp = (1.0 / z) * ((b + fma(x, (9.0 * y), (a * (z * (t * -4.0))))) / c);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
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(y * Float64(x * 9.0)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2.0) tmp = t_1; elseif (t_1 <= 2e-225) tmp = Float64(Float64(1.0 / z) * Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(a * Float64(z * Float64(t * Float64(-4.0)))))) / c)); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a / Float64(c / t)) * -4.0); 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[(y * N[(x * 9.0), $MachinePrecision]), $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, -2.0], t$95$1, If[LessEqual[t$95$1, 2e-225], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(a * N[(z * N[(t * (-4.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{\left(y \cdot \left(x \cdot 9\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t_1 \leq -2:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-225}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b + \mathsf{fma}\left(x, 9 \cdot y, a \cdot \left(z \cdot \left(t \cdot \left(-4\right)\right)\right)\right)}{c}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\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 or 1.9999999999999999e-225 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.2%
if -2 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 1.9999999999999999e-225Initial program 72.9%
associate-+l-72.9%
associate-*r*72.9%
associate-*r*73.0%
*-un-lft-identity73.0%
times-frac99.7%
associate--r-99.7%
fma-neg99.7%
associate-*r*99.5%
distribute-rgt-neg-in99.5%
associate-*l*99.5%
Applied egg-rr99.5%
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%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
associate-/l*77.3%
Simplified77.3%
Final simplification89.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 (/ (+ (- (* y (* x 9.0)) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -2e-263)
t_1
(if (<= t_1 0.0)
(* (/ 1.0 c) (/ (+ b (* -4.0 (* a (* z t)))) z))
(if (<= t_1 INFINITY) t_1 (* (/ a (/ c t)) -4.0))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-263) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (1.0 / c) * ((b + (-4.0 * (a * (z * t)))) / z);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
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 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-263) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (1.0 / c) * ((b + (-4.0 * (a * (z * t)))) / z);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c) tmp = 0 if t_1 <= -2e-263: tmp = t_1 elif t_1 <= 0.0: tmp = (1.0 / c) * ((b + (-4.0 * (a * (z * t)))) / z) elif t_1 <= math.inf: tmp = t_1 else: tmp = (a / (c / t)) * -4.0 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(y * Float64(x * 9.0)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-263) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(1.0 / c) * Float64(Float64(b + Float64(-4.0 * Float64(a * Float64(z * t)))) / z)); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a / Float64(c / t)) * -4.0); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c);
tmp = 0.0;
if (t_1 <= -2e-263)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = (1.0 / c) * ((b + (-4.0 * (a * (z * t)))) / z);
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = (a / (c / t)) * -4.0;
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[(y * N[(x * 9.0), $MachinePrecision]), $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-263], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / c), $MachinePrecision] * N[(N[(b + N[(-4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{\left(y \cdot \left(x \cdot 9\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-263}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{1}{c} \cdot \frac{b + -4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -2e-263 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 90.0%
if -2e-263 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -0.0Initial program 39.1%
associate-/r*99.7%
associate-+l-99.7%
associate-*r*99.7%
associate-*r*99.7%
div-inv99.8%
associate--r-99.8%
fma-neg99.8%
associate-*r*99.8%
distribute-rgt-neg-in99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 86.6%
*-commutative86.6%
Simplified86.6%
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%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
associate-/l*77.3%
Simplified77.3%
Final simplification88.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 (* (/ 1.0 c) (/ (+ b (* -4.0 (* a (* z t)))) z)))
(t_2 (/ (+ b (* 9.0 (* x y))) (* z c))))
(if (<= z -6.7e+118)
(* (/ 1.0 c) (* t (* a -4.0)))
(if (<= z -7e+53)
t_1
(if (<= z -2.9)
(* 9.0 (/ y (* z (/ c x))))
(if (<= z 9.6e-57)
t_2
(if (<= z 4.3e+61)
t_1
(if (<= z 9e+106) t_2 (* -4.0 (/ t (/ 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 t_1 = (1.0 / c) * ((b + (-4.0 * (a * (z * t)))) / z);
double t_2 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (z <= -6.7e+118) {
tmp = (1.0 / c) * (t * (a * -4.0));
} else if (z <= -7e+53) {
tmp = t_1;
} else if (z <= -2.9) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (z <= 9.6e-57) {
tmp = t_2;
} else if (z <= 4.3e+61) {
tmp = t_1;
} else if (z <= 9e+106) {
tmp = t_2;
} else {
tmp = -4.0 * (t / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (1.0d0 / c) * ((b + ((-4.0d0) * (a * (z * t)))) / z)
t_2 = (b + (9.0d0 * (x * y))) / (z * c)
if (z <= (-6.7d+118)) then
tmp = (1.0d0 / c) * (t * (a * (-4.0d0)))
else if (z <= (-7d+53)) then
tmp = t_1
else if (z <= (-2.9d0)) then
tmp = 9.0d0 * (y / (z * (c / x)))
else if (z <= 9.6d-57) then
tmp = t_2
else if (z <= 4.3d+61) then
tmp = t_1
else if (z <= 9d+106) then
tmp = t_2
else
tmp = (-4.0d0) * (t / (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 t_1 = (1.0 / c) * ((b + (-4.0 * (a * (z * t)))) / z);
double t_2 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (z <= -6.7e+118) {
tmp = (1.0 / c) * (t * (a * -4.0));
} else if (z <= -7e+53) {
tmp = t_1;
} else if (z <= -2.9) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (z <= 9.6e-57) {
tmp = t_2;
} else if (z <= 4.3e+61) {
tmp = t_1;
} else if (z <= 9e+106) {
tmp = t_2;
} else {
tmp = -4.0 * (t / (c / a));
}
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 / c) * ((b + (-4.0 * (a * (z * t)))) / z) t_2 = (b + (9.0 * (x * y))) / (z * c) tmp = 0 if z <= -6.7e+118: tmp = (1.0 / c) * (t * (a * -4.0)) elif z <= -7e+53: tmp = t_1 elif z <= -2.9: tmp = 9.0 * (y / (z * (c / x))) elif z <= 9.6e-57: tmp = t_2 elif z <= 4.3e+61: tmp = t_1 elif z <= 9e+106: tmp = t_2 else: tmp = -4.0 * (t / (c / a)) 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 / c) * Float64(Float64(b + Float64(-4.0 * Float64(a * Float64(z * t)))) / z)) t_2 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) tmp = 0.0 if (z <= -6.7e+118) tmp = Float64(Float64(1.0 / c) * Float64(t * Float64(a * -4.0))); elseif (z <= -7e+53) tmp = t_1; elseif (z <= -2.9) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); elseif (z <= 9.6e-57) tmp = t_2; elseif (z <= 4.3e+61) tmp = t_1; elseif (z <= 9e+106) tmp = t_2; else tmp = Float64(-4.0 * Float64(t / 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)
t_1 = (1.0 / c) * ((b + (-4.0 * (a * (z * t)))) / z);
t_2 = (b + (9.0 * (x * y))) / (z * c);
tmp = 0.0;
if (z <= -6.7e+118)
tmp = (1.0 / c) * (t * (a * -4.0));
elseif (z <= -7e+53)
tmp = t_1;
elseif (z <= -2.9)
tmp = 9.0 * (y / (z * (c / x)));
elseif (z <= 9.6e-57)
tmp = t_2;
elseif (z <= 4.3e+61)
tmp = t_1;
elseif (z <= 9e+106)
tmp = t_2;
else
tmp = -4.0 * (t / (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_] := Block[{t$95$1 = N[(N[(1.0 / c), $MachinePrecision] * N[(N[(b + N[(-4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.7e+118], N[(N[(1.0 / c), $MachinePrecision] * N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e+53], t$95$1, If[LessEqual[z, -2.9], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.6e-57], t$95$2, If[LessEqual[z, 4.3e+61], t$95$1, If[LessEqual[z, 9e+106], t$95$2, N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{1}{c} \cdot \frac{b + -4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z}\\
t_2 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{if}\;z \leq -6.7 \cdot 10^{+118}:\\
\;\;\;\;\frac{1}{c} \cdot \left(t \cdot \left(a \cdot -4\right)\right)\\
\mathbf{elif}\;z \leq -7 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.9:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-57}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+106}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if z < -6.7000000000000003e118Initial program 33.3%
associate-/r*48.8%
associate-+l-48.8%
associate-*r*48.8%
associate-*r*66.6%
div-inv66.6%
associate--r-66.6%
fma-neg69.9%
associate-*r*52.0%
distribute-rgt-neg-in52.0%
associate-*l*52.0%
Applied egg-rr52.0%
Taylor expanded in z around inf 76.4%
associate-*r*76.4%
Simplified76.4%
if -6.7000000000000003e118 < z < -7.00000000000000038e53 or 9.60000000000000025e-57 < z < 4.3000000000000001e61Initial program 83.0%
associate-/r*89.4%
associate-+l-89.4%
associate-*r*89.4%
associate-*r*91.6%
div-inv91.5%
associate--r-91.5%
fma-neg91.5%
associate-*r*89.4%
distribute-rgt-neg-in89.4%
associate-*l*89.4%
Applied egg-rr89.4%
Taylor expanded in x around 0 78.6%
*-commutative78.6%
Simplified78.6%
if -7.00000000000000038e53 < z < -2.89999999999999991Initial program 56.6%
Taylor expanded in x around inf 41.1%
associate-*r/41.2%
associate-*r*41.1%
*-commutative41.1%
times-frac76.7%
*-commutative76.7%
Simplified76.7%
clear-num76.7%
frac-times76.8%
*-un-lft-identity76.8%
*-un-lft-identity76.8%
times-frac76.7%
metadata-eval76.7%
Applied egg-rr76.7%
*-rgt-identity76.7%
associate-*l*76.8%
*-commutative76.8%
times-frac76.8%
metadata-eval76.8%
*-commutative76.8%
Simplified76.8%
if -2.89999999999999991 < z < 9.60000000000000025e-57 or 4.3000000000000001e61 < z < 8.9999999999999994e106Initial program 95.7%
Taylor expanded in x around inf 84.8%
if 8.9999999999999994e106 < z Initial program 61.4%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in a around 0 57.4%
*-commutative57.4%
associate-/l*54.5%
Simplified54.5%
Final simplification78.5%
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))))
(if (<= z -2e+117)
(* (/ 1.0 c) (* t (* a -4.0)))
(if (<= z -3e+54)
(/ (- b (* z (* a (* 4.0 t)))) (* z c))
(if (<= z -2.9)
(* 9.0 (/ y (* z (/ c x))))
(if (<= z 1.4e-54)
t_1
(if (<= z 2.2e+58)
(/ (- b (* 4.0 (* a (* z t)))) (* z c))
(if (<= z 1.8e+107) t_1 (* -4.0 (/ t (/ 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 t_1 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (z <= -2e+117) {
tmp = (1.0 / c) * (t * (a * -4.0));
} else if (z <= -3e+54) {
tmp = (b - (z * (a * (4.0 * t)))) / (z * c);
} else if (z <= -2.9) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (z <= 1.4e-54) {
tmp = t_1;
} else if (z <= 2.2e+58) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else if (z <= 1.8e+107) {
tmp = t_1;
} else {
tmp = -4.0 * (t / (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) :: t_1
real(8) :: tmp
t_1 = (b + (9.0d0 * (x * y))) / (z * c)
if (z <= (-2d+117)) then
tmp = (1.0d0 / c) * (t * (a * (-4.0d0)))
else if (z <= (-3d+54)) then
tmp = (b - (z * (a * (4.0d0 * t)))) / (z * c)
else if (z <= (-2.9d0)) then
tmp = 9.0d0 * (y / (z * (c / x)))
else if (z <= 1.4d-54) then
tmp = t_1
else if (z <= 2.2d+58) then
tmp = (b - (4.0d0 * (a * (z * t)))) / (z * c)
else if (z <= 1.8d+107) then
tmp = t_1
else
tmp = (-4.0d0) * (t / (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 t_1 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (z <= -2e+117) {
tmp = (1.0 / c) * (t * (a * -4.0));
} else if (z <= -3e+54) {
tmp = (b - (z * (a * (4.0 * t)))) / (z * c);
} else if (z <= -2.9) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (z <= 1.4e-54) {
tmp = t_1;
} else if (z <= 2.2e+58) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else if (z <= 1.8e+107) {
tmp = t_1;
} else {
tmp = -4.0 * (t / (c / a));
}
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) tmp = 0 if z <= -2e+117: tmp = (1.0 / c) * (t * (a * -4.0)) elif z <= -3e+54: tmp = (b - (z * (a * (4.0 * t)))) / (z * c) elif z <= -2.9: tmp = 9.0 * (y / (z * (c / x))) elif z <= 1.4e-54: tmp = t_1 elif z <= 2.2e+58: tmp = (b - (4.0 * (a * (z * t)))) / (z * c) elif z <= 1.8e+107: tmp = t_1 else: tmp = -4.0 * (t / (c / a)) 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)) tmp = 0.0 if (z <= -2e+117) tmp = Float64(Float64(1.0 / c) * Float64(t * Float64(a * -4.0))); elseif (z <= -3e+54) tmp = Float64(Float64(b - Float64(z * Float64(a * Float64(4.0 * t)))) / Float64(z * c)); elseif (z <= -2.9) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); elseif (z <= 1.4e-54) tmp = t_1; elseif (z <= 2.2e+58) tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / Float64(z * c)); elseif (z <= 1.8e+107) tmp = t_1; else tmp = Float64(-4.0 * Float64(t / 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)
t_1 = (b + (9.0 * (x * y))) / (z * c);
tmp = 0.0;
if (z <= -2e+117)
tmp = (1.0 / c) * (t * (a * -4.0));
elseif (z <= -3e+54)
tmp = (b - (z * (a * (4.0 * t)))) / (z * c);
elseif (z <= -2.9)
tmp = 9.0 * (y / (z * (c / x)));
elseif (z <= 1.4e-54)
tmp = t_1;
elseif (z <= 2.2e+58)
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
elseif (z <= 1.8e+107)
tmp = t_1;
else
tmp = -4.0 * (t / (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_] := Block[{t$95$1 = N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+117], N[(N[(1.0 / c), $MachinePrecision] * N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e+54], N[(N[(b - N[(z * N[(a * N[(4.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.9], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-54], t$95$1, If[LessEqual[z, 2.2e+58], N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+107], t$95$1, N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+117}:\\
\;\;\;\;\frac{1}{c} \cdot \left(t \cdot \left(a \cdot -4\right)\right)\\
\mathbf{elif}\;z \leq -3 \cdot 10^{+54}:\\
\;\;\;\;\frac{b - z \cdot \left(a \cdot \left(4 \cdot t\right)\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq -2.9:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+58}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if z < -2.0000000000000001e117Initial program 33.3%
associate-/r*48.8%
associate-+l-48.8%
associate-*r*48.8%
associate-*r*66.6%
div-inv66.6%
associate--r-66.6%
fma-neg69.9%
associate-*r*52.0%
distribute-rgt-neg-in52.0%
associate-*l*52.0%
Applied egg-rr52.0%
Taylor expanded in z around inf 76.4%
associate-*r*76.4%
Simplified76.4%
if -2.0000000000000001e117 < z < -2.9999999999999999e54Initial program 73.9%
Taylor expanded in x around 0 69.4%
associate-*r*73.7%
*-commutative73.7%
associate-*l*73.7%
*-commutative73.7%
associate-*r*73.7%
*-commutative73.7%
Simplified73.7%
if -2.9999999999999999e54 < z < -2.89999999999999991Initial program 56.6%
Taylor expanded in x around inf 41.1%
associate-*r/41.2%
associate-*r*41.1%
*-commutative41.1%
times-frac76.7%
*-commutative76.7%
Simplified76.7%
clear-num76.7%
frac-times76.8%
*-un-lft-identity76.8%
*-un-lft-identity76.8%
times-frac76.7%
metadata-eval76.7%
Applied egg-rr76.7%
*-rgt-identity76.7%
associate-*l*76.8%
*-commutative76.8%
times-frac76.8%
metadata-eval76.8%
*-commutative76.8%
Simplified76.8%
if -2.89999999999999991 < z < 1.4000000000000001e-54 or 2.2000000000000001e58 < z < 1.7999999999999999e107Initial program 95.7%
Taylor expanded in x around inf 84.8%
if 1.4000000000000001e-54 < z < 2.2000000000000001e58Initial program 91.4%
associate-+l-91.4%
associate-*l*91.4%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 75.0%
if 1.7999999999999999e107 < z Initial program 61.4%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in a around 0 57.4%
*-commutative57.4%
associate-/l*54.5%
Simplified54.5%
Final simplification77.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 (* 9.0 (/ x (* z (/ c y))))) (t_2 (* (/ 1.0 z) (/ b c))))
(if (<= a -7.6e-44)
(* (/ a (/ c t)) -4.0)
(if (<= a 3e-256)
t_1
(if (<= a 5.2e+15)
t_2
(if (<= a 2.9e+75)
t_1
(if (<= a 5.8e+142)
t_2
(if (<= a 1.55e+172) t_1 (* -4.0 (/ t (/ 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 t_1 = 9.0 * (x / (z * (c / y)));
double t_2 = (1.0 / z) * (b / c);
double tmp;
if (a <= -7.6e-44) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 3e-256) {
tmp = t_1;
} else if (a <= 5.2e+15) {
tmp = t_2;
} else if (a <= 2.9e+75) {
tmp = t_1;
} else if (a <= 5.8e+142) {
tmp = t_2;
} else if (a <= 1.55e+172) {
tmp = t_1;
} else {
tmp = -4.0 * (t / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (x / (z * (c / y)))
t_2 = (1.0d0 / z) * (b / c)
if (a <= (-7.6d-44)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 3d-256) then
tmp = t_1
else if (a <= 5.2d+15) then
tmp = t_2
else if (a <= 2.9d+75) then
tmp = t_1
else if (a <= 5.8d+142) then
tmp = t_2
else if (a <= 1.55d+172) then
tmp = t_1
else
tmp = (-4.0d0) * (t / (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 t_1 = 9.0 * (x / (z * (c / y)));
double t_2 = (1.0 / z) * (b / c);
double tmp;
if (a <= -7.6e-44) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 3e-256) {
tmp = t_1;
} else if (a <= 5.2e+15) {
tmp = t_2;
} else if (a <= 2.9e+75) {
tmp = t_1;
} else if (a <= 5.8e+142) {
tmp = t_2;
} else if (a <= 1.55e+172) {
tmp = t_1;
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * (x / (z * (c / y))) t_2 = (1.0 / z) * (b / c) tmp = 0 if a <= -7.6e-44: tmp = (a / (c / t)) * -4.0 elif a <= 3e-256: tmp = t_1 elif a <= 5.2e+15: tmp = t_2 elif a <= 2.9e+75: tmp = t_1 elif a <= 5.8e+142: tmp = t_2 elif a <= 1.55e+172: tmp = t_1 else: tmp = -4.0 * (t / (c / a)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(x / Float64(z * Float64(c / y)))) t_2 = Float64(Float64(1.0 / z) * Float64(b / c)) tmp = 0.0 if (a <= -7.6e-44) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 3e-256) tmp = t_1; elseif (a <= 5.2e+15) tmp = t_2; elseif (a <= 2.9e+75) tmp = t_1; elseif (a <= 5.8e+142) tmp = t_2; elseif (a <= 1.55e+172) tmp = t_1; else tmp = Float64(-4.0 * Float64(t / 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)
t_1 = 9.0 * (x / (z * (c / y)));
t_2 = (1.0 / z) * (b / c);
tmp = 0.0;
if (a <= -7.6e-44)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 3e-256)
tmp = t_1;
elseif (a <= 5.2e+15)
tmp = t_2;
elseif (a <= 2.9e+75)
tmp = t_1;
elseif (a <= 5.8e+142)
tmp = t_2;
elseif (a <= 1.55e+172)
tmp = t_1;
else
tmp = -4.0 * (t / (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_] := Block[{t$95$1 = N[(9.0 * N[(x / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.6e-44], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 3e-256], t$95$1, If[LessEqual[a, 5.2e+15], t$95$2, If[LessEqual[a, 2.9e+75], t$95$1, If[LessEqual[a, 5.8e+142], t$95$2, If[LessEqual[a, 1.55e+172], t$95$1, N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \frac{x}{z \cdot \frac{c}{y}}\\
t_2 := \frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{if}\;a \leq -7.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+142}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+172}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -7.6000000000000002e-44Initial program 83.5%
Taylor expanded in z around inf 54.3%
*-commutative54.3%
associate-/l*58.0%
Simplified58.0%
if -7.6000000000000002e-44 < a < 2.9999999999999998e-256 or 5.2e15 < a < 2.8999999999999998e75 or 5.80000000000000027e142 < a < 1.54999999999999994e172Initial program 79.0%
associate-+l-79.0%
associate-*r*79.0%
associate-*r*84.6%
*-un-lft-identity84.6%
times-frac80.2%
associate--r-80.2%
fma-neg80.2%
associate-*r*75.7%
distribute-rgt-neg-in75.7%
associate-*l*74.5%
Applied egg-rr74.5%
Taylor expanded in x around inf 52.8%
associate-/l*58.0%
*-commutative58.0%
*-lft-identity58.0%
times-frac57.0%
/-rgt-identity57.0%
Simplified57.0%
if 2.9999999999999998e-256 < a < 5.2e15 or 2.8999999999999998e75 < a < 5.80000000000000027e142Initial program 76.1%
associate-+l-76.1%
associate-*r*74.7%
associate-*r*77.8%
*-un-lft-identity77.8%
times-frac90.1%
associate--r-90.1%
fma-neg90.1%
associate-*r*81.6%
distribute-rgt-neg-in81.6%
associate-*l*81.6%
Applied egg-rr81.6%
Taylor expanded in b around inf 51.3%
if 1.54999999999999994e172 < a Initial program 77.4%
Taylor expanded in z around inf 71.9%
*-commutative71.9%
associate-/l*71.4%
Simplified71.4%
Taylor expanded in a around 0 71.9%
*-commutative71.9%
associate-/l*83.9%
Simplified83.9%
Final simplification58.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 (* 9.0 (/ x (* z (/ c y))))) (t_2 (* (/ 1.0 z) (/ b c))))
(if (<= a -3.4e-43)
(* (/ a (/ c t)) -4.0)
(if (<= a 1.22e-256)
t_1
(if (<= a 8.8e+15)
t_2
(if (<= a 4.8e+76)
t_1
(if (<= a 2.3e+143)
t_2
(if (<= a 1.55e+172)
(* 9.0 (/ y (* z (/ c x))))
(* -4.0 (/ t (/ 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 t_1 = 9.0 * (x / (z * (c / y)));
double t_2 = (1.0 / z) * (b / c);
double tmp;
if (a <= -3.4e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.22e-256) {
tmp = t_1;
} else if (a <= 8.8e+15) {
tmp = t_2;
} else if (a <= 4.8e+76) {
tmp = t_1;
} else if (a <= 2.3e+143) {
tmp = t_2;
} else if (a <= 1.55e+172) {
tmp = 9.0 * (y / (z * (c / x)));
} else {
tmp = -4.0 * (t / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (x / (z * (c / y)))
t_2 = (1.0d0 / z) * (b / c)
if (a <= (-3.4d-43)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 1.22d-256) then
tmp = t_1
else if (a <= 8.8d+15) then
tmp = t_2
else if (a <= 4.8d+76) then
tmp = t_1
else if (a <= 2.3d+143) then
tmp = t_2
else if (a <= 1.55d+172) then
tmp = 9.0d0 * (y / (z * (c / x)))
else
tmp = (-4.0d0) * (t / (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 t_1 = 9.0 * (x / (z * (c / y)));
double t_2 = (1.0 / z) * (b / c);
double tmp;
if (a <= -3.4e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.22e-256) {
tmp = t_1;
} else if (a <= 8.8e+15) {
tmp = t_2;
} else if (a <= 4.8e+76) {
tmp = t_1;
} else if (a <= 2.3e+143) {
tmp = t_2;
} else if (a <= 1.55e+172) {
tmp = 9.0 * (y / (z * (c / x)));
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * (x / (z * (c / y))) t_2 = (1.0 / z) * (b / c) tmp = 0 if a <= -3.4e-43: tmp = (a / (c / t)) * -4.0 elif a <= 1.22e-256: tmp = t_1 elif a <= 8.8e+15: tmp = t_2 elif a <= 4.8e+76: tmp = t_1 elif a <= 2.3e+143: tmp = t_2 elif a <= 1.55e+172: tmp = 9.0 * (y / (z * (c / x))) else: tmp = -4.0 * (t / (c / a)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(x / Float64(z * Float64(c / y)))) t_2 = Float64(Float64(1.0 / z) * Float64(b / c)) tmp = 0.0 if (a <= -3.4e-43) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 1.22e-256) tmp = t_1; elseif (a <= 8.8e+15) tmp = t_2; elseif (a <= 4.8e+76) tmp = t_1; elseif (a <= 2.3e+143) tmp = t_2; elseif (a <= 1.55e+172) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); else tmp = Float64(-4.0 * Float64(t / 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)
t_1 = 9.0 * (x / (z * (c / y)));
t_2 = (1.0 / z) * (b / c);
tmp = 0.0;
if (a <= -3.4e-43)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 1.22e-256)
tmp = t_1;
elseif (a <= 8.8e+15)
tmp = t_2;
elseif (a <= 4.8e+76)
tmp = t_1;
elseif (a <= 2.3e+143)
tmp = t_2;
elseif (a <= 1.55e+172)
tmp = 9.0 * (y / (z * (c / x)));
else
tmp = -4.0 * (t / (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_] := Block[{t$95$1 = N[(9.0 * N[(x / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.4e-43], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 1.22e-256], t$95$1, If[LessEqual[a, 8.8e+15], t$95$2, If[LessEqual[a, 4.8e+76], t$95$1, If[LessEqual[a, 2.3e+143], t$95$2, If[LessEqual[a, 1.55e+172], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \frac{x}{z \cdot \frac{c}{y}}\\
t_2 := \frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{if}\;a \leq -3.4 \cdot 10^{-43}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{+15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+172}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -3.4000000000000001e-43Initial program 83.5%
Taylor expanded in z around inf 54.3%
*-commutative54.3%
associate-/l*58.0%
Simplified58.0%
if -3.4000000000000001e-43 < a < 1.2199999999999999e-256 or 8.8e15 < a < 4.8e76Initial program 78.4%
associate-+l-78.4%
associate-*r*78.5%
associate-*r*84.5%
*-un-lft-identity84.5%
times-frac79.7%
associate--r-79.7%
fma-neg79.7%
associate-*r*74.8%
distribute-rgt-neg-in74.8%
associate-*l*73.6%
Applied egg-rr73.6%
Taylor expanded in x around inf 49.9%
associate-/l*55.6%
*-commutative55.6%
*-lft-identity55.6%
times-frac54.5%
/-rgt-identity54.5%
Simplified54.5%
if 1.2199999999999999e-256 < a < 8.8e15 or 4.8e76 < a < 2.3e143Initial program 76.1%
associate-+l-76.1%
associate-*r*74.7%
associate-*r*77.8%
*-un-lft-identity77.8%
times-frac90.1%
associate--r-90.1%
fma-neg90.1%
associate-*r*81.6%
distribute-rgt-neg-in81.6%
associate-*l*81.6%
Applied egg-rr81.6%
Taylor expanded in b around inf 51.3%
if 2.3e143 < a < 1.54999999999999994e172Initial program 85.5%
Taylor expanded in x around inf 85.7%
associate-*r/85.5%
associate-*r*85.5%
*-commutative85.5%
times-frac85.5%
*-commutative85.5%
Simplified85.5%
clear-num85.5%
frac-times85.5%
*-un-lft-identity85.5%
*-un-lft-identity85.5%
times-frac85.7%
metadata-eval85.7%
Applied egg-rr85.7%
*-rgt-identity85.7%
associate-*l*85.7%
*-commutative85.7%
times-frac85.7%
metadata-eval85.7%
*-commutative85.7%
Simplified85.7%
if 1.54999999999999994e172 < a Initial program 77.4%
Taylor expanded in z around inf 71.9%
*-commutative71.9%
associate-/l*71.4%
Simplified71.4%
Taylor expanded in a around 0 71.9%
*-commutative71.9%
associate-/l*83.9%
Simplified83.9%
Final simplification58.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 (* (/ 1.0 z) (/ b c))))
(if (<= a -3.8e-43)
(* (/ a (/ c t)) -4.0)
(if (<= a 3.1e-251)
(* (/ (* x 9.0) c) (/ y z))
(if (<= a 6.8e+15)
t_1
(if (<= a 1.8e+77)
(* 9.0 (/ x (* z (/ c y))))
(if (<= a 8.8e+142)
t_1
(if (<= a 1.55e+172)
(* 9.0 (/ y (* z (/ c x))))
(* -4.0 (/ t (/ 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 t_1 = (1.0 / z) * (b / c);
double tmp;
if (a <= -3.8e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 3.1e-251) {
tmp = ((x * 9.0) / c) * (y / z);
} else if (a <= 6.8e+15) {
tmp = t_1;
} else if (a <= 1.8e+77) {
tmp = 9.0 * (x / (z * (c / y)));
} else if (a <= 8.8e+142) {
tmp = t_1;
} else if (a <= 1.55e+172) {
tmp = 9.0 * (y / (z * (c / x)));
} else {
tmp = -4.0 * (t / (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) :: t_1
real(8) :: tmp
t_1 = (1.0d0 / z) * (b / c)
if (a <= (-3.8d-43)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 3.1d-251) then
tmp = ((x * 9.0d0) / c) * (y / z)
else if (a <= 6.8d+15) then
tmp = t_1
else if (a <= 1.8d+77) then
tmp = 9.0d0 * (x / (z * (c / y)))
else if (a <= 8.8d+142) then
tmp = t_1
else if (a <= 1.55d+172) then
tmp = 9.0d0 * (y / (z * (c / x)))
else
tmp = (-4.0d0) * (t / (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 t_1 = (1.0 / z) * (b / c);
double tmp;
if (a <= -3.8e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 3.1e-251) {
tmp = ((x * 9.0) / c) * (y / z);
} else if (a <= 6.8e+15) {
tmp = t_1;
} else if (a <= 1.8e+77) {
tmp = 9.0 * (x / (z * (c / y)));
} else if (a <= 8.8e+142) {
tmp = t_1;
} else if (a <= 1.55e+172) {
tmp = 9.0 * (y / (z * (c / x)));
} else {
tmp = -4.0 * (t / (c / a));
}
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) * (b / c) tmp = 0 if a <= -3.8e-43: tmp = (a / (c / t)) * -4.0 elif a <= 3.1e-251: tmp = ((x * 9.0) / c) * (y / z) elif a <= 6.8e+15: tmp = t_1 elif a <= 1.8e+77: tmp = 9.0 * (x / (z * (c / y))) elif a <= 8.8e+142: tmp = t_1 elif a <= 1.55e+172: tmp = 9.0 * (y / (z * (c / x))) else: tmp = -4.0 * (t / (c / a)) 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(b / c)) tmp = 0.0 if (a <= -3.8e-43) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 3.1e-251) tmp = Float64(Float64(Float64(x * 9.0) / c) * Float64(y / z)); elseif (a <= 6.8e+15) tmp = t_1; elseif (a <= 1.8e+77) tmp = Float64(9.0 * Float64(x / Float64(z * Float64(c / y)))); elseif (a <= 8.8e+142) tmp = t_1; elseif (a <= 1.55e+172) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); else tmp = Float64(-4.0 * Float64(t / 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)
t_1 = (1.0 / z) * (b / c);
tmp = 0.0;
if (a <= -3.8e-43)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 3.1e-251)
tmp = ((x * 9.0) / c) * (y / z);
elseif (a <= 6.8e+15)
tmp = t_1;
elseif (a <= 1.8e+77)
tmp = 9.0 * (x / (z * (c / y)));
elseif (a <= 8.8e+142)
tmp = t_1;
elseif (a <= 1.55e+172)
tmp = 9.0 * (y / (z * (c / x)));
else
tmp = -4.0 * (t / (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_] := Block[{t$95$1 = N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e-43], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 3.1e-251], N[(N[(N[(x * 9.0), $MachinePrecision] / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.8e+15], t$95$1, If[LessEqual[a, 1.8e+77], N[(9.0 * N[(x / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.8e+142], t$95$1, If[LessEqual[a, 1.55e+172], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-251}:\\
\;\;\;\;\frac{x \cdot 9}{c} \cdot \frac{y}{z}\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+77}:\\
\;\;\;\;9 \cdot \frac{x}{z \cdot \frac{c}{y}}\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+172}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -3.7999999999999997e-43Initial program 83.5%
Taylor expanded in z around inf 54.3%
*-commutative54.3%
associate-/l*58.0%
Simplified58.0%
if -3.7999999999999997e-43 < a < 3.10000000000000003e-251Initial program 76.5%
Taylor expanded in x around inf 47.5%
associate-*r/47.5%
associate-*r*47.5%
*-commutative47.5%
times-frac51.9%
*-commutative51.9%
Simplified51.9%
if 3.10000000000000003e-251 < a < 6.8e15 or 1.7999999999999999e77 < a < 8.79999999999999947e142Initial program 77.1%
associate-+l-77.1%
associate-*r*75.7%
associate-*r*77.5%
*-un-lft-identity77.5%
times-frac89.9%
associate--r-89.9%
fma-neg89.9%
associate-*r*82.7%
distribute-rgt-neg-in82.7%
associate-*l*82.7%
Applied egg-rr82.7%
Taylor expanded in b around inf 52.0%
if 6.8e15 < a < 1.7999999999999999e77Initial program 81.0%
associate-+l-81.0%
associate-*r*81.1%
associate-*r*81.0%
*-un-lft-identity81.0%
times-frac65.0%
associate--r-65.0%
fma-neg65.0%
associate-*r*65.0%
distribute-rgt-neg-in65.0%
associate-*l*65.0%
Applied egg-rr65.0%
Taylor expanded in x around inf 55.5%
associate-/l*59.5%
*-commutative59.5%
*-lft-identity59.5%
times-frac54.8%
/-rgt-identity54.8%
Simplified54.8%
if 8.79999999999999947e142 < a < 1.54999999999999994e172Initial program 85.5%
Taylor expanded in x around inf 85.7%
associate-*r/85.5%
associate-*r*85.5%
*-commutative85.5%
times-frac85.5%
*-commutative85.5%
Simplified85.5%
clear-num85.5%
frac-times85.5%
*-un-lft-identity85.5%
*-un-lft-identity85.5%
times-frac85.7%
metadata-eval85.7%
Applied egg-rr85.7%
*-rgt-identity85.7%
associate-*l*85.7%
*-commutative85.7%
times-frac85.7%
metadata-eval85.7%
*-commutative85.7%
Simplified85.7%
if 1.54999999999999994e172 < a Initial program 77.4%
Taylor expanded in z around inf 71.9%
*-commutative71.9%
associate-/l*71.4%
Simplified71.4%
Taylor expanded in a around 0 71.9%
*-commutative71.9%
associate-/l*83.9%
Simplified83.9%
Final simplification57.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (/ 1.0 z) (/ b c))))
(if (<= a -1.65e-43)
(* (/ a (/ c t)) -4.0)
(if (<= a 2.6e-254)
(/ 9.0 (* (/ c x) (/ z y)))
(if (<= a 8e+16)
t_1
(if (<= a 1.5e+77)
(* 9.0 (/ x (* z (/ c y))))
(if (<= a 1.25e+143)
t_1
(if (<= a 1.55e+172)
(* 9.0 (/ y (* z (/ c x))))
(* -4.0 (/ t (/ 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 t_1 = (1.0 / z) * (b / c);
double tmp;
if (a <= -1.65e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 2.6e-254) {
tmp = 9.0 / ((c / x) * (z / y));
} else if (a <= 8e+16) {
tmp = t_1;
} else if (a <= 1.5e+77) {
tmp = 9.0 * (x / (z * (c / y)));
} else if (a <= 1.25e+143) {
tmp = t_1;
} else if (a <= 1.55e+172) {
tmp = 9.0 * (y / (z * (c / x)));
} else {
tmp = -4.0 * (t / (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) :: t_1
real(8) :: tmp
t_1 = (1.0d0 / z) * (b / c)
if (a <= (-1.65d-43)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 2.6d-254) then
tmp = 9.0d0 / ((c / x) * (z / y))
else if (a <= 8d+16) then
tmp = t_1
else if (a <= 1.5d+77) then
tmp = 9.0d0 * (x / (z * (c / y)))
else if (a <= 1.25d+143) then
tmp = t_1
else if (a <= 1.55d+172) then
tmp = 9.0d0 * (y / (z * (c / x)))
else
tmp = (-4.0d0) * (t / (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 t_1 = (1.0 / z) * (b / c);
double tmp;
if (a <= -1.65e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 2.6e-254) {
tmp = 9.0 / ((c / x) * (z / y));
} else if (a <= 8e+16) {
tmp = t_1;
} else if (a <= 1.5e+77) {
tmp = 9.0 * (x / (z * (c / y)));
} else if (a <= 1.25e+143) {
tmp = t_1;
} else if (a <= 1.55e+172) {
tmp = 9.0 * (y / (z * (c / x)));
} else {
tmp = -4.0 * (t / (c / a));
}
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) * (b / c) tmp = 0 if a <= -1.65e-43: tmp = (a / (c / t)) * -4.0 elif a <= 2.6e-254: tmp = 9.0 / ((c / x) * (z / y)) elif a <= 8e+16: tmp = t_1 elif a <= 1.5e+77: tmp = 9.0 * (x / (z * (c / y))) elif a <= 1.25e+143: tmp = t_1 elif a <= 1.55e+172: tmp = 9.0 * (y / (z * (c / x))) else: tmp = -4.0 * (t / (c / a)) 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(b / c)) tmp = 0.0 if (a <= -1.65e-43) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 2.6e-254) tmp = Float64(9.0 / Float64(Float64(c / x) * Float64(z / y))); elseif (a <= 8e+16) tmp = t_1; elseif (a <= 1.5e+77) tmp = Float64(9.0 * Float64(x / Float64(z * Float64(c / y)))); elseif (a <= 1.25e+143) tmp = t_1; elseif (a <= 1.55e+172) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); else tmp = Float64(-4.0 * Float64(t / 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)
t_1 = (1.0 / z) * (b / c);
tmp = 0.0;
if (a <= -1.65e-43)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 2.6e-254)
tmp = 9.0 / ((c / x) * (z / y));
elseif (a <= 8e+16)
tmp = t_1;
elseif (a <= 1.5e+77)
tmp = 9.0 * (x / (z * (c / y)));
elseif (a <= 1.25e+143)
tmp = t_1;
elseif (a <= 1.55e+172)
tmp = 9.0 * (y / (z * (c / x)));
else
tmp = -4.0 * (t / (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_] := Block[{t$95$1 = N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e-43], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 2.6e-254], N[(9.0 / N[(N[(c / x), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e+16], t$95$1, If[LessEqual[a, 1.5e+77], N[(9.0 * N[(x / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+143], t$95$1, If[LessEqual[a, 1.55e+172], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{-43}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-254}:\\
\;\;\;\;\frac{9}{\frac{c}{x} \cdot \frac{z}{y}}\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+77}:\\
\;\;\;\;9 \cdot \frac{x}{z \cdot \frac{c}{y}}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+172}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -1.65000000000000008e-43Initial program 83.5%
Taylor expanded in z around inf 54.3%
*-commutative54.3%
associate-/l*58.0%
Simplified58.0%
if -1.65000000000000008e-43 < a < 2.6e-254Initial program 77.7%
Taylor expanded in x around inf 48.2%
associate-*r/48.3%
associate-*r*48.2%
*-commutative48.2%
times-frac52.7%
*-commutative52.7%
Simplified52.7%
*-commutative52.7%
clear-num52.6%
associate-/l*52.6%
frac-times53.2%
metadata-eval53.2%
Applied egg-rr53.2%
if 2.6e-254 < a < 8e16 or 1.4999999999999999e77 < a < 1.25000000000000003e143Initial program 76.1%
associate-+l-76.1%
associate-*r*74.7%
associate-*r*77.8%
*-un-lft-identity77.8%
times-frac90.1%
associate--r-90.1%
fma-neg90.1%
associate-*r*81.6%
distribute-rgt-neg-in81.6%
associate-*l*81.6%
Applied egg-rr81.6%
Taylor expanded in b around inf 51.3%
if 8e16 < a < 1.4999999999999999e77Initial program 81.0%
associate-+l-81.0%
associate-*r*81.1%
associate-*r*81.0%
*-un-lft-identity81.0%
times-frac65.0%
associate--r-65.0%
fma-neg65.0%
associate-*r*65.0%
distribute-rgt-neg-in65.0%
associate-*l*65.0%
Applied egg-rr65.0%
Taylor expanded in x around inf 55.5%
associate-/l*59.5%
*-commutative59.5%
*-lft-identity59.5%
times-frac54.8%
/-rgt-identity54.8%
Simplified54.8%
if 1.25000000000000003e143 < a < 1.54999999999999994e172Initial program 85.5%
Taylor expanded in x around inf 85.7%
associate-*r/85.5%
associate-*r*85.5%
*-commutative85.5%
times-frac85.5%
*-commutative85.5%
Simplified85.5%
clear-num85.5%
frac-times85.5%
*-un-lft-identity85.5%
*-un-lft-identity85.5%
times-frac85.7%
metadata-eval85.7%
Applied egg-rr85.7%
*-rgt-identity85.7%
associate-*l*85.7%
*-commutative85.7%
times-frac85.7%
metadata-eval85.7%
*-commutative85.7%
Simplified85.7%
if 1.54999999999999994e172 < a Initial program 77.4%
Taylor expanded in z around inf 71.9%
*-commutative71.9%
associate-/l*71.4%
Simplified71.4%
Taylor expanded in a around 0 71.9%
*-commutative71.9%
associate-/l*83.9%
Simplified83.9%
Final simplification57.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* z t))) (t_2 (* 9.0 (* x y))))
(if (<= b -3.15e-19)
(* (/ 1.0 c) (/ (+ b (* -4.0 t_1)) z))
(if (<= b 4.3e+48)
(/ (- t_2 (* 4.0 t_1)) (* z c))
(/ (+ b t_2) (* 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 = a * (z * t);
double t_2 = 9.0 * (x * y);
double tmp;
if (b <= -3.15e-19) {
tmp = (1.0 / c) * ((b + (-4.0 * t_1)) / z);
} else if (b <= 4.3e+48) {
tmp = (t_2 - (4.0 * t_1)) / (z * c);
} else {
tmp = (b + t_2) / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (z * t)
t_2 = 9.0d0 * (x * y)
if (b <= (-3.15d-19)) then
tmp = (1.0d0 / c) * ((b + ((-4.0d0) * t_1)) / z)
else if (b <= 4.3d+48) then
tmp = (t_2 - (4.0d0 * t_1)) / (z * c)
else
tmp = (b + t_2) / (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 t_1 = a * (z * t);
double t_2 = 9.0 * (x * y);
double tmp;
if (b <= -3.15e-19) {
tmp = (1.0 / c) * ((b + (-4.0 * t_1)) / z);
} else if (b <= 4.3e+48) {
tmp = (t_2 - (4.0 * t_1)) / (z * c);
} else {
tmp = (b + t_2) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = a * (z * t) t_2 = 9.0 * (x * y) tmp = 0 if b <= -3.15e-19: tmp = (1.0 / c) * ((b + (-4.0 * t_1)) / z) elif b <= 4.3e+48: tmp = (t_2 - (4.0 * t_1)) / (z * c) else: tmp = (b + t_2) / (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(a * Float64(z * t)) t_2 = Float64(9.0 * Float64(x * y)) tmp = 0.0 if (b <= -3.15e-19) tmp = Float64(Float64(1.0 / c) * Float64(Float64(b + Float64(-4.0 * t_1)) / z)); elseif (b <= 4.3e+48) tmp = Float64(Float64(t_2 - Float64(4.0 * t_1)) / Float64(z * c)); else tmp = Float64(Float64(b + t_2) / 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)
t_1 = a * (z * t);
t_2 = 9.0 * (x * y);
tmp = 0.0;
if (b <= -3.15e-19)
tmp = (1.0 / c) * ((b + (-4.0 * t_1)) / z);
elseif (b <= 4.3e+48)
tmp = (t_2 - (4.0 * t_1)) / (z * c);
else
tmp = (b + t_2) / (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_] := Block[{t$95$1 = N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.15e-19], N[(N[(1.0 / c), $MachinePrecision] * N[(N[(b + N[(-4.0 * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.3e+48], N[(N[(t$95$2 - N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b + t$95$2), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot t\right)\\
t_2 := 9 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;b \leq -3.15 \cdot 10^{-19}:\\
\;\;\;\;\frac{1}{c} \cdot \frac{b + -4 \cdot t_1}{z}\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{+48}:\\
\;\;\;\;\frac{t_2 - 4 \cdot t_1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + t_2}{z \cdot c}\\
\end{array}
\end{array}
if b < -3.15000000000000009e-19Initial program 75.0%
associate-/r*79.3%
associate-+l-79.3%
associate-*r*77.9%
associate-*r*86.2%
div-inv86.1%
associate--r-86.1%
fma-neg86.1%
associate-*r*77.9%
distribute-rgt-neg-in77.9%
associate-*l*77.9%
Applied egg-rr77.9%
Taylor expanded in x around 0 72.3%
*-commutative72.3%
Simplified72.3%
if -3.15000000000000009e-19 < b < 4.29999999999999978e48Initial program 78.1%
associate-+l-78.1%
associate-*l*78.9%
associate-*l*78.3%
Simplified78.3%
Taylor expanded in b around 0 73.7%
if 4.29999999999999978e48 < b Initial program 89.8%
Taylor expanded in x around inf 83.3%
Final simplification75.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
(if (<= a -4.2e-43)
(* (/ a (/ c t)) -4.0)
(if (<= a 1.55e+172)
(/ (+ b (* 9.0 (* x y))) (* z c))
(/ (- b (* 4.0 (* a (* z t)))) (* 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 <= -4.2e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.55e+172) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (b - (4.0 * (a * (z * t)))) / (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 <= (-4.2d-43)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 1.55d+172) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (b - (4.0d0 * (a * (z * t)))) / (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 <= -4.2e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.55e+172) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (b - (4.0 * (a * (z * t)))) / (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 <= -4.2e-43: tmp = (a / (c / t)) * -4.0 elif a <= 1.55e+172: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = (b - (4.0 * (a * (z * t)))) / (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 <= -4.2e-43) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 1.55e+172) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / 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 <= -4.2e-43)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 1.55e+172)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = (b - (4.0 * (a * (z * t)))) / (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[a, -4.2e-43], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 1.55e+172], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $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 -4.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+172}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if a < -4.2000000000000001e-43Initial program 83.5%
Taylor expanded in z around inf 54.3%
*-commutative54.3%
associate-/l*58.0%
Simplified58.0%
if -4.2000000000000001e-43 < a < 1.54999999999999994e172Initial program 77.7%
Taylor expanded in x around inf 70.3%
if 1.54999999999999994e172 < a Initial program 77.4%
associate-+l-77.4%
associate-*l*77.4%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in x around 0 76.6%
Final simplification67.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 (<= a -4.2e-43)
(* (/ a (/ c t)) -4.0)
(if (<= a 1.65e+172)
(/ (+ b (* 9.0 (* x y))) (* z c))
(* -4.0 (/ t (/ 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 <= -4.2e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.65e+172) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (t / (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 <= (-4.2d-43)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 1.65d+172) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (-4.0d0) * (t / (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 <= -4.2e-43) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.65e+172) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (t / (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 <= -4.2e-43: tmp = (a / (c / t)) * -4.0 elif a <= 1.65e+172: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = -4.0 * (t / (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 <= -4.2e-43) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 1.65e+172) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t / 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 <= -4.2e-43)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 1.65e+172)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = -4.0 * (t / (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, -4.2e-43], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 1.65e+172], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $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 -4.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+172}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -4.2000000000000001e-43Initial program 83.5%
Taylor expanded in z around inf 54.3%
*-commutative54.3%
associate-/l*58.0%
Simplified58.0%
if -4.2000000000000001e-43 < a < 1.64999999999999991e172Initial program 77.7%
Taylor expanded in x around inf 70.3%
if 1.64999999999999991e172 < a Initial program 77.4%
Taylor expanded in z around inf 71.9%
*-commutative71.9%
associate-/l*71.4%
Simplified71.4%
Taylor expanded in a around 0 71.9%
*-commutative71.9%
associate-/l*83.9%
Simplified83.9%
Final simplification67.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 (<= b -118.0) (/ (/ b z) c) (if (<= b 2.5e+47) (* (* a -4.0) (/ t c)) (* b (/ 1.0 (* 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 (b <= -118.0) {
tmp = (b / z) / c;
} else if (b <= 2.5e+47) {
tmp = (a * -4.0) * (t / c);
} else {
tmp = b * (1.0 / (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 (b <= (-118.0d0)) then
tmp = (b / z) / c
else if (b <= 2.5d+47) then
tmp = (a * (-4.0d0)) * (t / c)
else
tmp = b * (1.0d0 / (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 (b <= -118.0) {
tmp = (b / z) / c;
} else if (b <= 2.5e+47) {
tmp = (a * -4.0) * (t / c);
} else {
tmp = b * (1.0 / (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 b <= -118.0: tmp = (b / z) / c elif b <= 2.5e+47: tmp = (a * -4.0) * (t / c) else: tmp = b * (1.0 / (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 (b <= -118.0) tmp = Float64(Float64(b / z) / c); elseif (b <= 2.5e+47) tmp = Float64(Float64(a * -4.0) * Float64(t / c)); else tmp = Float64(b * Float64(1.0 / 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 (b <= -118.0)
tmp = (b / z) / c;
elseif (b <= 2.5e+47)
tmp = (a * -4.0) * (t / c);
else
tmp = b * (1.0 / (z * c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -118.0], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 2.5e+47], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -118:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+47}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\end{array}
\end{array}
if b < -118Initial program 75.6%
associate-+l-75.6%
associate-*r*74.1%
associate-*r*78.7%
clear-num78.8%
inv-pow78.8%
associate--r-78.8%
fma-neg78.8%
associate-*r*74.0%
distribute-rgt-neg-in74.0%
associate-*l*74.0%
Applied egg-rr74.0%
Simplified80.4%
Taylor expanded in b around inf 57.7%
*-commutative57.7%
associate-/r*62.1%
Simplified62.1%
if -118 < b < 2.50000000000000011e47Initial program 77.7%
associate-+l-77.7%
associate-*r*78.5%
associate-*r*77.9%
clear-num77.4%
inv-pow77.4%
associate--r-77.4%
fma-neg77.4%
associate-*r*78.0%
distribute-rgt-neg-in78.0%
associate-*l*77.3%
Applied egg-rr77.3%
Simplified77.4%
Taylor expanded in z around inf 48.6%
associate-*r/48.6%
associate-*r*48.6%
associate-*r/51.4%
*-commutative51.4%
Simplified51.4%
if 2.50000000000000011e47 < b Initial program 89.8%
Taylor expanded in b around inf 60.0%
*-commutative60.0%
Simplified60.0%
div-inv60.1%
Applied egg-rr60.1%
Final simplification55.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 (<= b -0.00011) (/ (/ b z) c) (if (<= b 8.2e+28) (* (* a -4.0) (/ t c)) (* (/ 1.0 z) (/ 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 (b <= -0.00011) {
tmp = (b / z) / c;
} else if (b <= 8.2e+28) {
tmp = (a * -4.0) * (t / c);
} else {
tmp = (1.0 / z) * (b / 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 (b <= (-0.00011d0)) then
tmp = (b / z) / c
else if (b <= 8.2d+28) then
tmp = (a * (-4.0d0)) * (t / c)
else
tmp = (1.0d0 / z) * (b / 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 (b <= -0.00011) {
tmp = (b / z) / c;
} else if (b <= 8.2e+28) {
tmp = (a * -4.0) * (t / c);
} else {
tmp = (1.0 / z) * (b / 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 b <= -0.00011: tmp = (b / z) / c elif b <= 8.2e+28: tmp = (a * -4.0) * (t / c) else: tmp = (1.0 / z) * (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 (b <= -0.00011) tmp = Float64(Float64(b / z) / c); elseif (b <= 8.2e+28) tmp = Float64(Float64(a * -4.0) * Float64(t / c)); else tmp = Float64(Float64(1.0 / z) * Float64(b / 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 (b <= -0.00011)
tmp = (b / z) / c;
elseif (b <= 8.2e+28)
tmp = (a * -4.0) * (t / c);
else
tmp = (1.0 / z) * (b / 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[b, -0.00011], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 8.2e+28], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.00011:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{+28}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\
\end{array}
\end{array}
if b < -1.10000000000000004e-4Initial program 75.6%
associate-+l-75.6%
associate-*r*74.1%
associate-*r*78.7%
clear-num78.8%
inv-pow78.8%
associate--r-78.8%
fma-neg78.8%
associate-*r*74.0%
distribute-rgt-neg-in74.0%
associate-*l*74.0%
Applied egg-rr74.0%
Simplified80.4%
Taylor expanded in b around inf 57.7%
*-commutative57.7%
associate-/r*62.1%
Simplified62.1%
if -1.10000000000000004e-4 < b < 8.19999999999999961e28Initial program 77.3%
associate-+l-77.3%
associate-*r*78.0%
associate-*r*77.4%
clear-num76.9%
inv-pow76.9%
associate--r-76.9%
fma-neg76.9%
associate-*r*77.5%
distribute-rgt-neg-in77.5%
associate-*l*76.8%
Applied egg-rr76.8%
Simplified76.9%
Taylor expanded in z around inf 48.8%
associate-*r/48.8%
associate-*r*48.8%
associate-*r/51.1%
*-commutative51.1%
Simplified51.1%
if 8.19999999999999961e28 < b Initial program 89.4%
associate-+l-89.4%
associate-*r*89.4%
associate-*r*87.7%
*-un-lft-identity87.7%
times-frac81.4%
associate--r-81.4%
fma-neg81.4%
associate-*r*84.7%
distribute-rgt-neg-in84.7%
associate-*l*84.7%
Applied egg-rr84.7%
Taylor expanded in b around inf 58.2%
Final simplification55.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 (if (<= b -2e+42) (/ (/ b z) c) (if (<= b 3.5e+38) (* -4.0 (/ t (/ c a))) (* (/ 1.0 z) (/ 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 (b <= -2e+42) {
tmp = (b / z) / c;
} else if (b <= 3.5e+38) {
tmp = -4.0 * (t / (c / a));
} else {
tmp = (1.0 / z) * (b / 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 (b <= (-2d+42)) then
tmp = (b / z) / c
else if (b <= 3.5d+38) then
tmp = (-4.0d0) * (t / (c / a))
else
tmp = (1.0d0 / z) * (b / 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 (b <= -2e+42) {
tmp = (b / z) / c;
} else if (b <= 3.5e+38) {
tmp = -4.0 * (t / (c / a));
} else {
tmp = (1.0 / z) * (b / 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 b <= -2e+42: tmp = (b / z) / c elif b <= 3.5e+38: tmp = -4.0 * (t / (c / a)) else: tmp = (1.0 / z) * (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 (b <= -2e+42) tmp = Float64(Float64(b / z) / c); elseif (b <= 3.5e+38) tmp = Float64(-4.0 * Float64(t / Float64(c / a))); else tmp = Float64(Float64(1.0 / z) * Float64(b / 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 (b <= -2e+42)
tmp = (b / z) / c;
elseif (b <= 3.5e+38)
tmp = -4.0 * (t / (c / a));
else
tmp = (1.0 / z) * (b / 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[b, -2e+42], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 3.5e+38], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+42}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+38}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\
\end{array}
\end{array}
if b < -2.00000000000000009e42Initial program 74.8%
associate-+l-74.8%
associate-*r*72.9%
associate-*r*78.3%
clear-num78.4%
inv-pow78.4%
associate--r-78.4%
fma-neg78.4%
associate-*r*73.0%
distribute-rgt-neg-in73.0%
associate-*l*73.0%
Applied egg-rr73.0%
Simplified80.3%
Taylor expanded in b around inf 60.5%
*-commutative60.5%
associate-/r*67.5%
Simplified67.5%
if -2.00000000000000009e42 < b < 3.50000000000000002e38Initial program 78.0%
Taylor expanded in z around inf 48.4%
*-commutative48.4%
associate-/l*51.1%
Simplified51.1%
Taylor expanded in a around 0 48.4%
*-commutative48.4%
associate-/l*48.2%
Simplified48.2%
if 3.50000000000000002e38 < b Initial program 88.6%
associate-+l-88.6%
associate-*r*88.6%
associate-*r*86.8%
*-un-lft-identity86.8%
times-frac79.9%
associate--r-79.9%
fma-neg79.9%
associate-*r*83.5%
distribute-rgt-neg-in83.5%
associate-*l*83.5%
Applied egg-rr83.5%
Taylor expanded in b around inf 58.7%
Final simplification54.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 (if (<= b -8.5e+21) (/ 1.0 (/ z (/ b c))) (if (<= b 2.9e+38) (* -4.0 (/ t (/ c a))) (* (/ 1.0 z) (/ 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 (b <= -8.5e+21) {
tmp = 1.0 / (z / (b / c));
} else if (b <= 2.9e+38) {
tmp = -4.0 * (t / (c / a));
} else {
tmp = (1.0 / z) * (b / 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 (b <= (-8.5d+21)) then
tmp = 1.0d0 / (z / (b / c))
else if (b <= 2.9d+38) then
tmp = (-4.0d0) * (t / (c / a))
else
tmp = (1.0d0 / z) * (b / 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 (b <= -8.5e+21) {
tmp = 1.0 / (z / (b / c));
} else if (b <= 2.9e+38) {
tmp = -4.0 * (t / (c / a));
} else {
tmp = (1.0 / z) * (b / 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 b <= -8.5e+21: tmp = 1.0 / (z / (b / c)) elif b <= 2.9e+38: tmp = -4.0 * (t / (c / a)) else: tmp = (1.0 / z) * (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 (b <= -8.5e+21) tmp = Float64(1.0 / Float64(z / Float64(b / c))); elseif (b <= 2.9e+38) tmp = Float64(-4.0 * Float64(t / Float64(c / a))); else tmp = Float64(Float64(1.0 / z) * Float64(b / 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 (b <= -8.5e+21)
tmp = 1.0 / (z / (b / c));
elseif (b <= 2.9e+38)
tmp = -4.0 * (t / (c / a));
else
tmp = (1.0 / z) * (b / 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[b, -8.5e+21], N[(1.0 / N[(z / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e+38], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{b}{c}}}\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+38}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\
\end{array}
\end{array}
if b < -8.5e21Initial program 75.7%
Taylor expanded in b around inf 59.6%
*-commutative59.6%
Simplified59.6%
clear-num59.6%
inv-pow59.6%
Applied egg-rr59.6%
unpow-159.6%
associate-/l*64.4%
Simplified64.4%
if -8.5e21 < b < 2.90000000000000007e38Initial program 77.8%
Taylor expanded in z around inf 48.9%
*-commutative48.9%
associate-/l*51.7%
Simplified51.7%
Taylor expanded in a around 0 48.9%
*-commutative48.9%
associate-/l*48.7%
Simplified48.7%
if 2.90000000000000007e38 < b Initial program 88.6%
associate-+l-88.6%
associate-*r*88.6%
associate-*r*86.8%
*-un-lft-identity86.8%
times-frac79.9%
associate--r-79.9%
fma-neg79.9%
associate-*r*83.5%
distribute-rgt-neg-in83.5%
associate-*l*83.5%
Applied egg-rr83.5%
Taylor expanded in b around inf 58.7%
Final simplification54.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 (/ 1.0 (* 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 * (1.0 / (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 * (1.0d0 / (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 * (1.0 / (z * c));
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b * (1.0 / (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(1.0 / 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 * (1.0 / (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[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
b \cdot \frac{1}{z \cdot c}
\end{array}
Initial program 79.5%
Taylor expanded in b around inf 35.6%
*-commutative35.6%
Simplified35.6%
div-inv36.8%
Applied egg-rr36.8%
Final simplification36.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 (/ 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 79.5%
Taylor expanded in b around inf 35.6%
*-commutative35.6%
Simplified35.6%
Final simplification35.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 2023336
(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)))