
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.5e-57)
(fma (/ (* a t) c) -4.0 (fma (/ x z) (/ 9.0 (/ c y)) (/ (/ b z) c)))
(if (<= z 7e-89)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (/ (- (* x (* 9.0 y)) (- (* (* z 4.0) (* a t)) b)) z) c))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.5e-57) {
tmp = fma(((a * t) / c), -4.0, fma((x / z), (9.0 / (c / y)), ((b / z) / c)));
} else if (z <= 7e-89) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (((x * (9.0 * y)) - (((z * 4.0) * (a * t)) - b)) / z) / c;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.5e-57) tmp = fma(Float64(Float64(a * t) / c), -4.0, fma(Float64(x / z), Float64(9.0 / Float64(c / y)), Float64(Float64(b / z) / c))); elseif (z <= 7e-89) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - b)) / z) / c); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.5e-57], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0 + N[(N[(x / z), $MachinePrecision] * N[(9.0 / N[(c / y), $MachinePrecision]), $MachinePrecision] + N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-89], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a \cdot t}{c}, -4, \mathsf{fma}\left(\frac{x}{z}, \frac{9}{\frac{c}{y}}, \frac{\frac{b}{z}}{c}\right)\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-89}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(9 \cdot y\right) - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - b\right)}{z}}{c}\\
\end{array}
\end{array}
if z < -1.5e-57Initial program 66.5%
associate-+l-66.5%
*-commutative66.5%
associate-*r*71.4%
*-commutative71.4%
associate-+l-71.4%
Simplified72.8%
Taylor expanded in x around 0 84.7%
cancel-sign-sub-inv84.7%
metadata-eval84.7%
+-commutative84.7%
*-commutative84.7%
fma-def84.7%
associate-*r/84.8%
associate-*r*84.8%
*-commutative84.8%
associate-*r*84.8%
*-commutative84.8%
times-frac89.8%
fma-def91.1%
associate-/l*91.0%
*-commutative91.0%
associate-/r*93.5%
Simplified93.5%
if -1.5e-57 < z < 6.9999999999999994e-89Initial program 97.9%
if 6.9999999999999994e-89 < z Initial program 73.6%
associate-+l-73.6%
*-commutative73.6%
associate-*r*74.9%
*-commutative74.9%
associate-+l-74.9%
Simplified82.3%
associate-/r*87.5%
div-inv87.4%
associate-+l-87.4%
associate-*r*76.4%
associate-+l-76.4%
associate-*l*76.4%
associate-*r*87.4%
Applied egg-rr87.4%
un-div-inv87.5%
associate-+l-87.5%
Applied egg-rr87.5%
Final simplification93.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= c -2.6e-10) (not (<= c 7.8e-42))) (fma -4.0 (/ a (/ c t)) (/ (+ (* 9.0 (/ (* x y) c)) (/ b c)) z)) (/ (/ (- (* x (* 9.0 y)) (- (* (* z 4.0) (* a t)) b)) z) c)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -2.6e-10) || !(c <= 7.8e-42)) {
tmp = fma(-4.0, (a / (c / t)), (((9.0 * ((x * y) / c)) + (b / c)) / z));
} else {
tmp = (((x * (9.0 * y)) - (((z * 4.0) * (a * t)) - b)) / z) / c;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -2.6e-10) || !(c <= 7.8e-42)) tmp = fma(-4.0, Float64(a / Float64(c / t)), Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / c)) + Float64(b / c)) / z)); else tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - b)) / z) / c); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[c, -2.6e-10], N[Not[LessEqual[c, 7.8e-42]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.6 \cdot 10^{-10} \lor \neg \left(c \leq 7.8 \cdot 10^{-42}\right):\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a}{\frac{c}{t}}, \frac{9 \cdot \frac{x \cdot y}{c} + \frac{b}{c}}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(9 \cdot y\right) - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - b\right)}{z}}{c}\\
\end{array}
\end{array}
if c < -2.59999999999999981e-10 or 7.8000000000000003e-42 < c Initial program 72.4%
associate-+l-72.4%
*-commutative72.4%
associate-*r*72.4%
*-commutative72.4%
associate-+l-72.4%
Simplified75.8%
Taylor expanded in x around 0 85.8%
cancel-sign-sub-inv85.8%
metadata-eval85.8%
+-commutative85.8%
fma-def85.8%
associate-/l*89.5%
fma-def89.5%
times-frac84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around 0 90.8%
if -2.59999999999999981e-10 < c < 7.8000000000000003e-42Initial program 92.1%
associate-+l-92.1%
*-commutative92.1%
associate-*r*94.7%
*-commutative94.7%
associate-+l-94.7%
Simplified94.6%
associate-/r*95.4%
div-inv95.3%
associate-+l-95.3%
associate-*r*92.9%
associate-+l-92.9%
associate-*l*92.9%
associate-*r*95.3%
Applied egg-rr95.3%
un-div-inv95.4%
associate-+l-95.4%
Applied egg-rr95.4%
Final simplification92.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* y (* x 9.0)))
(t_2 (/ (+ b (- t_1 (* a (* t (* z 4.0))))) (* z c)))
(t_3 (/ (+ b (- t_1 (* (* z 4.0) (* a t)))) (* z c))))
(if (<= t_2 -4e-262)
t_3
(if (<= t_2 0.0)
(/ (/ (+ b (- (* x (* 9.0 y)) (* z (* 4.0 (* a t))))) c) z)
(if (<= t_2 INFINITY) t_3 (* -4.0 (/ a (/ c t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double t_2 = (b + (t_1 - (a * (t * (z * 4.0))))) / (z * c);
double t_3 = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c);
double tmp;
if (t_2 <= -4e-262) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = ((b + ((x * (9.0 * y)) - (z * (4.0 * (a * t))))) / c) / z;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double t_2 = (b + (t_1 - (a * (t * (z * 4.0))))) / (z * c);
double t_3 = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c);
double tmp;
if (t_2 <= -4e-262) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = ((b + ((x * (9.0 * y)) - (z * (4.0 * (a * t))))) / c) / z;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = y * (x * 9.0) t_2 = (b + (t_1 - (a * (t * (z * 4.0))))) / (z * c) t_3 = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c) tmp = 0 if t_2 <= -4e-262: tmp = t_3 elif t_2 <= 0.0: tmp = ((b + ((x * (9.0 * y)) - (z * (4.0 * (a * t))))) / c) / z elif t_2 <= math.inf: tmp = t_3 else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(x * 9.0)) t_2 = Float64(Float64(b + Float64(t_1 - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)) t_3 = Float64(Float64(b + Float64(t_1 - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(z * c)) tmp = 0.0 if (t_2 <= -4e-262) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(z * Float64(4.0 * Float64(a * t))))) / c) / z); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = y * (x * 9.0);
t_2 = (b + (t_1 - (a * (t * (z * 4.0))))) / (z * c);
t_3 = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c);
tmp = 0.0;
if (t_2 <= -4e-262)
tmp = t_3;
elseif (t_2 <= 0.0)
tmp = ((b + ((x * (9.0 * y)) - (z * (4.0 * (a * t))))) / c) / z;
elseif (t_2 <= Inf)
tmp = t_3;
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(t$95$1 - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b + N[(t$95$1 - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-262], t$95$3, If[LessEqual[t$95$2, 0.0], N[(N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(z * N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
t_2 := \frac{b + \left(t_1 - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
t_3 := \frac{b + \left(t_1 - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{z \cdot c}\\
\mathbf{if}\;t_2 \leq -4 \cdot 10^{-262}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{\frac{b + \left(x \cdot \left(9 \cdot y\right) - z \cdot \left(4 \cdot \left(a \cdot t\right)\right)\right)}{c}}{z}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -4.00000000000000005e-262 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.3%
associate-+l-89.3%
*-commutative89.3%
associate-*r*90.5%
*-commutative90.5%
associate-+l-90.5%
Simplified92.1%
if -4.00000000000000005e-262 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 0.0Initial program 54.7%
associate-+l-54.7%
*-commutative54.7%
associate-*r*44.3%
*-commutative44.3%
associate-+l-44.3%
Simplified54.7%
*-un-lft-identity54.7%
times-frac99.7%
associate-+l-99.7%
associate-*r*99.7%
associate-+l-99.7%
associate-*l*99.5%
associate-*r*99.5%
Applied egg-rr99.5%
associate-*l/100.0%
*-un-lft-identity100.0%
+-commutative100.0%
associate-*l*100.0%
Applied egg-rr100.0%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
*-commutative0.0%
associate-*r*6.2%
*-commutative6.2%
associate-+l-6.2%
Simplified6.2%
Taylor expanded in z around inf 37.6%
*-commutative37.6%
associate-/l*51.5%
Simplified51.5%
Final simplification89.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(if (<= (/ (+ b (- t_1 (* a (* t (* z 4.0))))) (* z c)) INFINITY)
(/ (+ b (- t_1 (* (* z 4.0) (* a t)))) (* z c))
(* -4.0 (/ a (/ c t))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (((b + (t_1 - (a * (t * (z * 4.0))))) / (z * c)) <= ((double) INFINITY)) {
tmp = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (((b + (t_1 - (a * (t * (z * 4.0))))) / (z * c)) <= Double.POSITIVE_INFINITY) {
tmp = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = y * (x * 9.0) tmp = 0 if ((b + (t_1 - (a * (t * (z * 4.0))))) / (z * c)) <= math.inf: tmp = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c) else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if (Float64(Float64(b + Float64(t_1 - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)) <= Inf) tmp = Float64(Float64(b + Float64(t_1 - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = y * (x * 9.0);
tmp = 0.0;
if (((b + (t_1 - (a * (t * (z * 4.0))))) / (z * c)) <= Inf)
tmp = (b + (t_1 - ((z * 4.0) * (a * t)))) / (z * c);
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(b + N[(t$95$1 - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(b + N[(t$95$1 - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;\frac{b + \left(t_1 - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c} \leq \infty:\\
\;\;\;\;\frac{b + \left(t_1 - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
associate-*r*88.5%
*-commutative88.5%
associate-+l-88.5%
Simplified90.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%
associate-+l-0.0%
*-commutative0.0%
associate-*r*6.2%
*-commutative6.2%
associate-+l-6.2%
Simplified6.2%
Taylor expanded in z around inf 37.6%
*-commutative37.6%
associate-/l*51.5%
Simplified51.5%
Final simplification87.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 4.0 (* a (* z t)))))
(if (<= z -1.1e+256)
(/ b (* z c))
(if (<= z -1.15e+62)
(* (/ (* a t) c) -4.0)
(if (<= z -5e-37)
(/ (- (* 9.0 (* x y)) t_1) (* z c))
(if (<= z 1.4e+69)
(/ (+ b (* x (* 9.0 y))) (* z c))
(if (<= z 1.2e+232)
(/ (/ (- b t_1) z) c)
(* t (* -4.0 (/ a c))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 4.0 * (a * (z * t));
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -1.15e+62) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= -5e-37) {
tmp = ((9.0 * (x * y)) - t_1) / (z * c);
} else if (z <= 1.4e+69) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else if (z <= 1.2e+232) {
tmp = ((b - t_1) / z) / c;
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 4.0d0 * (a * (z * t))
if (z <= (-1.1d+256)) then
tmp = b / (z * c)
else if (z <= (-1.15d+62)) then
tmp = ((a * t) / c) * (-4.0d0)
else if (z <= (-5d-37)) then
tmp = ((9.0d0 * (x * y)) - t_1) / (z * c)
else if (z <= 1.4d+69) then
tmp = (b + (x * (9.0d0 * y))) / (z * c)
else if (z <= 1.2d+232) then
tmp = ((b - t_1) / z) / c
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 4.0 * (a * (z * t));
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -1.15e+62) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= -5e-37) {
tmp = ((9.0 * (x * y)) - t_1) / (z * c);
} else if (z <= 1.4e+69) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else if (z <= 1.2e+232) {
tmp = ((b - t_1) / z) / c;
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = 4.0 * (a * (z * t)) tmp = 0 if z <= -1.1e+256: tmp = b / (z * c) elif z <= -1.15e+62: tmp = ((a * t) / c) * -4.0 elif z <= -5e-37: tmp = ((9.0 * (x * y)) - t_1) / (z * c) elif z <= 1.4e+69: tmp = (b + (x * (9.0 * y))) / (z * c) elif z <= 1.2e+232: tmp = ((b - t_1) / z) / c else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(4.0 * Float64(a * Float64(z * t))) tmp = 0.0 if (z <= -1.1e+256) tmp = Float64(b / Float64(z * c)); elseif (z <= -1.15e+62) tmp = Float64(Float64(Float64(a * t) / c) * -4.0); elseif (z <= -5e-37) tmp = Float64(Float64(Float64(9.0 * Float64(x * y)) - t_1) / Float64(z * c)); elseif (z <= 1.4e+69) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c)); elseif (z <= 1.2e+232) tmp = Float64(Float64(Float64(b - t_1) / z) / c); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 4.0 * (a * (z * t));
tmp = 0.0;
if (z <= -1.1e+256)
tmp = b / (z * c);
elseif (z <= -1.15e+62)
tmp = ((a * t) / c) * -4.0;
elseif (z <= -5e-37)
tmp = ((9.0 * (x * y)) - t_1) / (z * c);
elseif (z <= 1.4e+69)
tmp = (b + (x * (9.0 * y))) / (z * c);
elseif (z <= 1.2e+232)
tmp = ((b - t_1) / z) / c;
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+256], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e+62], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, -5e-37], N[(N[(N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+69], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+232], N[(N[(N[(b - t$95$1), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+256}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+62}:\\
\;\;\;\;\frac{a \cdot t}{c} \cdot -4\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-37}:\\
\;\;\;\;\frac{9 \cdot \left(x \cdot y\right) - t_1}{z \cdot c}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+69}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+232}:\\
\;\;\;\;\frac{\frac{b - t_1}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -1.1e256Initial program 50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*59.1%
*-commutative59.1%
associate-+l-59.1%
Simplified67.4%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
if -1.1e256 < z < -1.14999999999999992e62Initial program 49.4%
associate-+l-49.4%
*-commutative49.4%
associate-*r*57.8%
*-commutative57.8%
associate-+l-57.8%
Simplified58.0%
Taylor expanded in z around inf 72.5%
*-commutative72.5%
Simplified72.5%
if -1.14999999999999992e62 < z < -4.9999999999999997e-37Initial program 88.0%
associate-+l-88.0%
*-commutative88.0%
associate-*r*88.0%
*-commutative88.0%
associate-+l-88.0%
Simplified88.0%
Taylor expanded in b around 0 76.4%
if -4.9999999999999997e-37 < z < 1.39999999999999991e69Initial program 97.0%
associate-+l-97.0%
*-commutative97.0%
associate-*r*96.3%
*-commutative96.3%
associate-+l-96.3%
Simplified95.5%
div-inv95.6%
associate-+l-95.6%
associate-*r*97.1%
associate-+l-97.1%
associate-*l*97.0%
associate-*r*95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 87.8%
associate-*r*87.9%
*-commutative87.9%
associate-*r*87.9%
*-commutative87.9%
Simplified87.9%
if 1.39999999999999991e69 < z < 1.2000000000000001e232Initial program 69.8%
associate-+l-69.8%
*-commutative69.8%
associate-*r*76.0%
*-commutative76.0%
associate-+l-76.0%
Simplified82.1%
associate-/r*91.0%
div-inv90.8%
associate-+l-90.8%
associate-*r*72.8%
associate-+l-72.8%
associate-*l*72.9%
associate-*r*90.8%
Applied egg-rr90.8%
un-div-inv91.0%
associate-+l-91.0%
Applied egg-rr91.0%
Taylor expanded in x around 0 64.4%
if 1.2000000000000001e232 < z Initial program 40.8%
associate-+l-40.8%
*-commutative40.8%
associate-*r*28.0%
*-commutative28.0%
associate-+l-28.0%
Simplified47.2%
div-inv47.2%
associate-+l-47.2%
associate-*r*40.8%
associate-+l-40.8%
associate-*l*40.8%
associate-*r*47.2%
Applied egg-rr47.2%
Taylor expanded in z around inf 55.5%
associate-*l/68.1%
*-commutative68.1%
*-commutative68.1%
associate-*l*68.1%
Simplified68.1%
Final simplification79.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.9e-65) (not (<= z 8.6e-89))) (/ (/ (- (* x (* 9.0 y)) (- (* (* z 4.0) (* a t)) b)) z) c) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.9e-65) || !(z <= 8.6e-89)) {
tmp = (((x * (9.0 * y)) - (((z * 4.0) * (a * t)) - b)) / z) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-1.9d-65)) .or. (.not. (z <= 8.6d-89))) then
tmp = (((x * (9.0d0 * y)) - (((z * 4.0d0) * (a * t)) - b)) / z) / c
else
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.9e-65) || !(z <= 8.6e-89)) {
tmp = (((x * (9.0 * y)) - (((z * 4.0) * (a * t)) - b)) / z) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.9e-65) or not (z <= 8.6e-89): tmp = (((x * (9.0 * y)) - (((z * 4.0) * (a * t)) - b)) / z) / c else: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.9e-65) || !(z <= 8.6e-89)) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - b)) / z) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -1.9e-65) || ~((z <= 8.6e-89)))
tmp = (((x * (9.0 * y)) - (((z * 4.0) * (a * t)) - b)) / z) / c;
else
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.9e-65], N[Not[LessEqual[z, 8.6e-89]], $MachinePrecision]], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-65} \lor \neg \left(z \leq 8.6 \cdot 10^{-89}\right):\\
\;\;\;\;\frac{\frac{x \cdot \left(9 \cdot y\right) - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - b\right)}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.9000000000000001e-65 or 8.59999999999999974e-89 < z Initial program 70.0%
associate-+l-70.0%
*-commutative70.0%
associate-*r*73.2%
*-commutative73.2%
associate-+l-73.2%
Simplified77.6%
associate-/r*83.3%
div-inv83.2%
associate-+l-83.2%
associate-*r*74.0%
associate-+l-74.0%
associate-*l*74.0%
associate-*r*83.2%
Applied egg-rr83.2%
un-div-inv83.3%
associate-+l-83.3%
Applied egg-rr83.3%
if -1.9000000000000001e-65 < z < 8.59999999999999974e-89Initial program 97.9%
Final simplification89.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.1e+256)
(/ b (* z c))
(if (<= z -1.4e+40)
(* (/ (* a t) c) -4.0)
(if (<= z 2.3e+73)
(/ (+ b (* x (* 9.0 y))) (* z c))
(if (<= z 3e+228)
(/ (/ (- b (* 4.0 (* a (* z t)))) z) c)
(* t (* -4.0 (/ a c))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -1.4e+40) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= 2.3e+73) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else if (z <= 3e+228) {
tmp = ((b - (4.0 * (a * (z * t)))) / z) / c;
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-1.1d+256)) then
tmp = b / (z * c)
else if (z <= (-1.4d+40)) then
tmp = ((a * t) / c) * (-4.0d0)
else if (z <= 2.3d+73) then
tmp = (b + (x * (9.0d0 * y))) / (z * c)
else if (z <= 3d+228) then
tmp = ((b - (4.0d0 * (a * (z * t)))) / z) / c
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -1.4e+40) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= 2.3e+73) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else if (z <= 3e+228) {
tmp = ((b - (4.0 * (a * (z * t)))) / z) / c;
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.1e+256: tmp = b / (z * c) elif z <= -1.4e+40: tmp = ((a * t) / c) * -4.0 elif z <= 2.3e+73: tmp = (b + (x * (9.0 * y))) / (z * c) elif z <= 3e+228: tmp = ((b - (4.0 * (a * (z * t)))) / z) / c else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.1e+256) tmp = Float64(b / Float64(z * c)); elseif (z <= -1.4e+40) tmp = Float64(Float64(Float64(a * t) / c) * -4.0); elseif (z <= 2.3e+73) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c)); elseif (z <= 3e+228) tmp = Float64(Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / z) / c); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -1.1e+256)
tmp = b / (z * c);
elseif (z <= -1.4e+40)
tmp = ((a * t) / c) * -4.0;
elseif (z <= 2.3e+73)
tmp = (b + (x * (9.0 * y))) / (z * c);
elseif (z <= 3e+228)
tmp = ((b - (4.0 * (a * (z * t)))) / z) / c;
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.1e+256], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e+40], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 2.3e+73], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+228], N[(N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+256}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{+40}:\\
\;\;\;\;\frac{a \cdot t}{c} \cdot -4\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+73}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+228}:\\
\;\;\;\;\frac{\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -1.1e256Initial program 50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*59.1%
*-commutative59.1%
associate-+l-59.1%
Simplified67.4%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
if -1.1e256 < z < -1.4000000000000001e40Initial program 50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*58.3%
*-commutative58.3%
associate-+l-58.3%
Simplified58.4%
Taylor expanded in z around inf 68.7%
*-commutative68.7%
Simplified68.7%
if -1.4000000000000001e40 < z < 2.3e73Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
associate-*r*96.1%
*-commutative96.1%
associate-+l-96.1%
Simplified95.4%
div-inv95.5%
associate-+l-95.5%
associate-*r*96.8%
associate-+l-96.8%
associate-*l*96.8%
associate-*r*95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 84.0%
associate-*r*84.1%
*-commutative84.1%
associate-*r*84.1%
*-commutative84.1%
Simplified84.1%
if 2.3e73 < z < 3.0000000000000001e228Initial program 69.8%
associate-+l-69.8%
*-commutative69.8%
associate-*r*76.0%
*-commutative76.0%
associate-+l-76.0%
Simplified82.1%
associate-/r*91.0%
div-inv90.8%
associate-+l-90.8%
associate-*r*72.8%
associate-+l-72.8%
associate-*l*72.9%
associate-*r*90.8%
Applied egg-rr90.8%
un-div-inv91.0%
associate-+l-91.0%
Applied egg-rr91.0%
Taylor expanded in x around 0 64.4%
if 3.0000000000000001e228 < z Initial program 40.8%
associate-+l-40.8%
*-commutative40.8%
associate-*r*28.0%
*-commutative28.0%
associate-+l-28.0%
Simplified47.2%
div-inv47.2%
associate-+l-47.2%
associate-*r*40.8%
associate-+l-40.8%
associate-*l*40.8%
associate-*r*47.2%
Applied egg-rr47.2%
Taylor expanded in z around inf 55.5%
associate-*l/68.1%
*-commutative68.1%
*-commutative68.1%
associate-*l*68.1%
Simplified68.1%
Final simplification77.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* z c))))
(if (<= z -1.1e+256)
t_1
(if (<= z -6e-37)
(* (/ (* a t) c) -4.0)
(if (<= z -1.85e-214)
(* b (/ (/ 1.0 c) z))
(if (<= z -9e-309)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= z 2.6e+36) t_1 (* t (* -4.0 (/ a c))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (z <= -1.1e+256) {
tmp = t_1;
} else if (z <= -6e-37) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= -1.85e-214) {
tmp = b * ((1.0 / c) / z);
} else if (z <= -9e-309) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (z <= 2.6e+36) {
tmp = t_1;
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = b / (z * c)
if (z <= (-1.1d+256)) then
tmp = t_1
else if (z <= (-6d-37)) then
tmp = ((a * t) / c) * (-4.0d0)
else if (z <= (-1.85d-214)) then
tmp = b * ((1.0d0 / c) / z)
else if (z <= (-9d-309)) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (z <= 2.6d+36) then
tmp = t_1
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (z <= -1.1e+256) {
tmp = t_1;
} else if (z <= -6e-37) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= -1.85e-214) {
tmp = b * ((1.0 / c) / z);
} else if (z <= -9e-309) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (z <= 2.6e+36) {
tmp = t_1;
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = b / (z * c) tmp = 0 if z <= -1.1e+256: tmp = t_1 elif z <= -6e-37: tmp = ((a * t) / c) * -4.0 elif z <= -1.85e-214: tmp = b * ((1.0 / c) / z) elif z <= -9e-309: tmp = 9.0 * ((x / c) * (y / z)) elif z <= 2.6e+36: tmp = t_1 else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(z * c)) tmp = 0.0 if (z <= -1.1e+256) tmp = t_1; elseif (z <= -6e-37) tmp = Float64(Float64(Float64(a * t) / c) * -4.0); elseif (z <= -1.85e-214) tmp = Float64(b * Float64(Float64(1.0 / c) / z)); elseif (z <= -9e-309) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (z <= 2.6e+36) tmp = t_1; else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = b / (z * c);
tmp = 0.0;
if (z <= -1.1e+256)
tmp = t_1;
elseif (z <= -6e-37)
tmp = ((a * t) / c) * -4.0;
elseif (z <= -1.85e-214)
tmp = b * ((1.0 / c) / z);
elseif (z <= -9e-309)
tmp = 9.0 * ((x / c) * (y / z));
elseif (z <= 2.6e+36)
tmp = t_1;
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+256], t$95$1, If[LessEqual[z, -6e-37], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, -1.85e-214], N[(b * N[(N[(1.0 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-309], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+36], t$95$1, N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-37}:\\
\;\;\;\;\frac{a \cdot t}{c} \cdot -4\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-214}:\\
\;\;\;\;b \cdot \frac{\frac{1}{c}}{z}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-309}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -1.1e256 or -9.0000000000000021e-309 < z < 2.6000000000000001e36Initial program 91.1%
associate-+l-91.1%
*-commutative91.1%
associate-*r*91.2%
*-commutative91.2%
associate-+l-91.2%
Simplified91.1%
Taylor expanded in b around inf 56.7%
*-commutative56.7%
Simplified56.7%
if -1.1e256 < z < -6e-37Initial program 65.7%
associate-+l-65.7%
*-commutative65.7%
associate-*r*70.6%
*-commutative70.6%
associate-+l-70.6%
Simplified70.7%
Taylor expanded in z around inf 61.0%
*-commutative61.0%
Simplified61.0%
if -6e-37 < z < -1.8500000000000001e-214Initial program 99.7%
associate-+l-99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in b around inf 61.9%
*-commutative61.9%
Simplified61.9%
div-inv65.2%
associate-/r*65.2%
Applied egg-rr65.2%
Taylor expanded in z around 0 65.2%
associate-/r*65.2%
Simplified65.2%
if -1.8500000000000001e-214 < z < -9.0000000000000021e-309Initial program 96.5%
associate-+l-96.5%
*-commutative96.5%
associate-*r*93.2%
*-commutative93.2%
associate-+l-93.2%
Simplified93.3%
Taylor expanded in x around inf 63.4%
frac-times56.9%
Applied egg-rr56.9%
if 2.6000000000000001e36 < z Initial program 61.0%
associate-+l-61.0%
*-commutative61.0%
associate-*r*63.0%
*-commutative63.0%
associate-+l-63.0%
Simplified72.6%
div-inv72.5%
associate-+l-72.5%
associate-*r*60.9%
associate-+l-60.9%
associate-*l*61.0%
associate-*r*72.5%
Applied egg-rr72.5%
Taylor expanded in z around inf 56.6%
associate-*l/59.6%
*-commutative59.6%
*-commutative59.6%
associate-*l*59.6%
Simplified59.6%
Final simplification59.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.1e+256)
(/ b (* z c))
(if (<= z -1.4e+40)
(* (/ (* a t) c) -4.0)
(if (<= z 1.4e+72)
(/ (+ b (* x (* 9.0 y))) (* z c))
(* t (* -4.0 (/ a c)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -1.4e+40) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= 1.4e+72) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-1.1d+256)) then
tmp = b / (z * c)
else if (z <= (-1.4d+40)) then
tmp = ((a * t) / c) * (-4.0d0)
else if (z <= 1.4d+72) then
tmp = (b + (x * (9.0d0 * y))) / (z * c)
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -1.4e+40) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= 1.4e+72) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.1e+256: tmp = b / (z * c) elif z <= -1.4e+40: tmp = ((a * t) / c) * -4.0 elif z <= 1.4e+72: tmp = (b + (x * (9.0 * y))) / (z * c) else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.1e+256) tmp = Float64(b / Float64(z * c)); elseif (z <= -1.4e+40) tmp = Float64(Float64(Float64(a * t) / c) * -4.0); elseif (z <= 1.4e+72) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c)); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -1.1e+256)
tmp = b / (z * c);
elseif (z <= -1.4e+40)
tmp = ((a * t) / c) * -4.0;
elseif (z <= 1.4e+72)
tmp = (b + (x * (9.0 * y))) / (z * c);
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.1e+256], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e+40], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 1.4e+72], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+256}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{+40}:\\
\;\;\;\;\frac{a \cdot t}{c} \cdot -4\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+72}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -1.1e256Initial program 50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*59.1%
*-commutative59.1%
associate-+l-59.1%
Simplified67.4%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
if -1.1e256 < z < -1.4000000000000001e40Initial program 50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*58.3%
*-commutative58.3%
associate-+l-58.3%
Simplified58.4%
Taylor expanded in z around inf 68.7%
*-commutative68.7%
Simplified68.7%
if -1.4000000000000001e40 < z < 1.4e72Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
associate-*r*96.1%
*-commutative96.1%
associate-+l-96.1%
Simplified95.4%
div-inv95.5%
associate-+l-95.5%
associate-*r*96.8%
associate-+l-96.8%
associate-*l*96.8%
associate-*r*95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 84.0%
associate-*r*84.1%
*-commutative84.1%
associate-*r*84.1%
*-commutative84.1%
Simplified84.1%
if 1.4e72 < z Initial program 60.5%
associate-+l-60.5%
*-commutative60.5%
associate-*r*60.7%
*-commutative60.7%
associate-+l-60.7%
Simplified70.9%
div-inv70.7%
associate-+l-70.7%
associate-*r*60.4%
associate-+l-60.4%
associate-*l*60.5%
associate-*r*70.8%
Applied egg-rr70.8%
Taylor expanded in z around inf 57.9%
associate-*l/61.0%
*-commutative61.0%
*-commutative61.0%
associate-*l*61.0%
Simplified61.0%
Final simplification76.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a 3.6e-261)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= a 7.2e-50)
(/ b (* z c))
(if (<= a 1.45e+74) (* 9.0 (* (/ x z) (/ y c))) (* t (* -4.0 (/ a c)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 3.6e-261) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 7.2e-50) {
tmp = b / (z * c);
} else if (a <= 1.45e+74) {
tmp = 9.0 * ((x / z) * (y / c));
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (a <= 3.6d-261) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (a <= 7.2d-50) then
tmp = b / (z * c)
else if (a <= 1.45d+74) then
tmp = 9.0d0 * ((x / z) * (y / c))
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 3.6e-261) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 7.2e-50) {
tmp = b / (z * c);
} else if (a <= 1.45e+74) {
tmp = 9.0 * ((x / z) * (y / c));
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= 3.6e-261: tmp = 9.0 * ((x / c) * (y / z)) elif a <= 7.2e-50: tmp = b / (z * c) elif a <= 1.45e+74: tmp = 9.0 * ((x / z) * (y / c)) else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= 3.6e-261) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (a <= 7.2e-50) tmp = Float64(b / Float64(z * c)); elseif (a <= 1.45e+74) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= 3.6e-261)
tmp = 9.0 * ((x / c) * (y / z));
elseif (a <= 7.2e-50)
tmp = b / (z * c);
elseif (a <= 1.45e+74)
tmp = 9.0 * ((x / z) * (y / c));
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, 3.6e-261], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-50], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.45e+74], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.6 \cdot 10^{-261}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+74}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if a < 3.59999999999999999e-261Initial program 77.7%
associate-+l-77.7%
*-commutative77.7%
associate-*r*81.9%
*-commutative81.9%
associate-+l-81.9%
Simplified83.2%
Taylor expanded in x around inf 42.4%
frac-times42.4%
Applied egg-rr42.4%
if 3.59999999999999999e-261 < a < 7.19999999999999958e-50Initial program 83.4%
associate-+l-83.4%
*-commutative83.4%
associate-*r*87.5%
*-commutative87.5%
associate-+l-87.5%
Simplified87.6%
Taylor expanded in b around inf 57.6%
*-commutative57.6%
Simplified57.6%
if 7.19999999999999958e-50 < a < 1.4500000000000001e74Initial program 89.1%
associate-+l-89.1%
*-commutative89.1%
associate-*r*85.2%
*-commutative85.2%
associate-+l-85.2%
Simplified89.1%
Taylor expanded in x around inf 54.7%
*-commutative54.7%
times-frac50.6%
Simplified50.6%
if 1.4500000000000001e74 < a Initial program 83.9%
associate-+l-83.9%
*-commutative83.9%
associate-*r*74.9%
*-commutative74.9%
associate-+l-74.9%
Simplified79.4%
div-inv79.4%
associate-+l-79.4%
associate-*r*84.0%
associate-+l-84.0%
associate-*l*84.0%
associate-*r*79.5%
Applied egg-rr79.5%
Taylor expanded in z around inf 52.7%
associate-*l/63.4%
*-commutative63.4%
*-commutative63.4%
associate-*l*63.4%
Simplified63.4%
Final simplification49.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a 4.2e-263)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= a 4e-50)
(/ b (* z c))
(if (<= a 1.08e+74) (* 9.0 (/ (* x y) (* z c))) (* t (* -4.0 (/ a c)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 4.2e-263) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 4e-50) {
tmp = b / (z * c);
} else if (a <= 1.08e+74) {
tmp = 9.0 * ((x * y) / (z * c));
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (a <= 4.2d-263) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (a <= 4d-50) then
tmp = b / (z * c)
else if (a <= 1.08d+74) then
tmp = 9.0d0 * ((x * y) / (z * c))
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 4.2e-263) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 4e-50) {
tmp = b / (z * c);
} else if (a <= 1.08e+74) {
tmp = 9.0 * ((x * y) / (z * c));
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= 4.2e-263: tmp = 9.0 * ((x / c) * (y / z)) elif a <= 4e-50: tmp = b / (z * c) elif a <= 1.08e+74: tmp = 9.0 * ((x * y) / (z * c)) else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= 4.2e-263) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (a <= 4e-50) tmp = Float64(b / Float64(z * c)); elseif (a <= 1.08e+74) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= 4.2e-263)
tmp = 9.0 * ((x / c) * (y / z));
elseif (a <= 4e-50)
tmp = b / (z * c);
elseif (a <= 1.08e+74)
tmp = 9.0 * ((x * y) / (z * c));
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, 4.2e-263], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e-50], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.08e+74], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.2 \cdot 10^{-263}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;a \leq 4 \cdot 10^{-50}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{+74}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if a < 4.20000000000000005e-263Initial program 77.7%
associate-+l-77.7%
*-commutative77.7%
associate-*r*81.9%
*-commutative81.9%
associate-+l-81.9%
Simplified83.2%
Taylor expanded in x around inf 42.4%
frac-times42.4%
Applied egg-rr42.4%
if 4.20000000000000005e-263 < a < 4.00000000000000003e-50Initial program 83.4%
associate-+l-83.4%
*-commutative83.4%
associate-*r*87.5%
*-commutative87.5%
associate-+l-87.5%
Simplified87.6%
Taylor expanded in b around inf 57.6%
*-commutative57.6%
Simplified57.6%
if 4.00000000000000003e-50 < a < 1.08e74Initial program 89.1%
associate-+l-89.1%
*-commutative89.1%
associate-*r*85.2%
*-commutative85.2%
associate-+l-85.2%
Simplified89.1%
Taylor expanded in x around inf 54.7%
if 1.08e74 < a Initial program 83.9%
associate-+l-83.9%
*-commutative83.9%
associate-*r*74.9%
*-commutative74.9%
associate-+l-74.9%
Simplified79.4%
div-inv79.4%
associate-+l-79.4%
associate-*r*84.0%
associate-+l-84.0%
associate-*l*84.0%
associate-*r*79.5%
Applied egg-rr79.5%
Taylor expanded in z around inf 52.7%
associate-*l/63.4%
*-commutative63.4%
*-commutative63.4%
associate-*l*63.4%
Simplified63.4%
Final simplification50.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a 2.5e-263)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= a 7.2e-50)
(/ b (* z c))
(if (<= a 3e+74) (/ (* 9.0 (* x y)) (* z c)) (* t (* -4.0 (/ a c)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 2.5e-263) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 7.2e-50) {
tmp = b / (z * c);
} else if (a <= 3e+74) {
tmp = (9.0 * (x * y)) / (z * c);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (a <= 2.5d-263) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (a <= 7.2d-50) then
tmp = b / (z * c)
else if (a <= 3d+74) then
tmp = (9.0d0 * (x * y)) / (z * c)
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 2.5e-263) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 7.2e-50) {
tmp = b / (z * c);
} else if (a <= 3e+74) {
tmp = (9.0 * (x * y)) / (z * c);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= 2.5e-263: tmp = 9.0 * ((x / c) * (y / z)) elif a <= 7.2e-50: tmp = b / (z * c) elif a <= 3e+74: tmp = (9.0 * (x * y)) / (z * c) else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= 2.5e-263) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (a <= 7.2e-50) tmp = Float64(b / Float64(z * c)); elseif (a <= 3e+74) tmp = Float64(Float64(9.0 * Float64(x * y)) / Float64(z * c)); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= 2.5e-263)
tmp = 9.0 * ((x / c) * (y / z));
elseif (a <= 7.2e-50)
tmp = b / (z * c);
elseif (a <= 3e+74)
tmp = (9.0 * (x * y)) / (z * c);
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, 2.5e-263], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-50], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e+74], N[(N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.5 \cdot 10^{-263}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+74}:\\
\;\;\;\;\frac{9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if a < 2.50000000000000003e-263Initial program 77.7%
associate-+l-77.7%
*-commutative77.7%
associate-*r*81.9%
*-commutative81.9%
associate-+l-81.9%
Simplified83.2%
Taylor expanded in x around inf 42.4%
frac-times42.4%
Applied egg-rr42.4%
if 2.50000000000000003e-263 < a < 7.19999999999999958e-50Initial program 83.4%
associate-+l-83.4%
*-commutative83.4%
associate-*r*87.5%
*-commutative87.5%
associate-+l-87.5%
Simplified87.6%
Taylor expanded in b around inf 57.6%
*-commutative57.6%
Simplified57.6%
if 7.19999999999999958e-50 < a < 3e74Initial program 89.1%
associate-+l-89.1%
*-commutative89.1%
associate-*r*85.2%
*-commutative85.2%
associate-+l-85.2%
Simplified89.1%
Taylor expanded in x around inf 54.7%
associate-*r/54.8%
*-commutative54.8%
Simplified54.8%
if 3e74 < a Initial program 83.9%
associate-+l-83.9%
*-commutative83.9%
associate-*r*74.9%
*-commutative74.9%
associate-+l-74.9%
Simplified79.4%
div-inv79.4%
associate-+l-79.4%
associate-*r*84.0%
associate-+l-84.0%
associate-*l*84.0%
associate-*r*79.5%
Applied egg-rr79.5%
Taylor expanded in z around inf 52.7%
associate-*l/63.4%
*-commutative63.4%
*-commutative63.4%
associate-*l*63.4%
Simplified63.4%
Final simplification50.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.1e+256)
(/ b (* z c))
(if (<= z -2.8e-37)
(* (* a t) (/ -4.0 c))
(if (<= z 3e+36) (* b (/ (/ 1.0 c) z)) (* t (* -4.0 (/ a c)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -2.8e-37) {
tmp = (a * t) * (-4.0 / c);
} else if (z <= 3e+36) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-1.1d+256)) then
tmp = b / (z * c)
else if (z <= (-2.8d-37)) then
tmp = (a * t) * ((-4.0d0) / c)
else if (z <= 3d+36) then
tmp = b * ((1.0d0 / c) / z)
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -2.8e-37) {
tmp = (a * t) * (-4.0 / c);
} else if (z <= 3e+36) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.1e+256: tmp = b / (z * c) elif z <= -2.8e-37: tmp = (a * t) * (-4.0 / c) elif z <= 3e+36: tmp = b * ((1.0 / c) / z) else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.1e+256) tmp = Float64(b / Float64(z * c)); elseif (z <= -2.8e-37) tmp = Float64(Float64(a * t) * Float64(-4.0 / c)); elseif (z <= 3e+36) tmp = Float64(b * Float64(Float64(1.0 / c) / z)); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -1.1e+256)
tmp = b / (z * c);
elseif (z <= -2.8e-37)
tmp = (a * t) * (-4.0 / c);
elseif (z <= 3e+36)
tmp = b * ((1.0 / c) / z);
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.1e+256], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e-37], N[(N[(a * t), $MachinePrecision] * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+36], N[(b * N[(N[(1.0 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+256}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-37}:\\
\;\;\;\;\left(a \cdot t\right) \cdot \frac{-4}{c}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+36}:\\
\;\;\;\;b \cdot \frac{\frac{1}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -1.1e256Initial program 50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*59.1%
*-commutative59.1%
associate-+l-59.1%
Simplified67.4%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
if -1.1e256 < z < -2.8000000000000001e-37Initial program 65.7%
associate-+l-65.7%
*-commutative65.7%
associate-*r*70.6%
*-commutative70.6%
associate-+l-70.6%
Simplified70.7%
associate-/r*78.8%
div-inv78.8%
associate-+l-78.8%
associate-*r*72.2%
associate-+l-72.2%
associate-*l*72.2%
associate-*r*78.8%
Applied egg-rr78.8%
Taylor expanded in z around inf 61.0%
*-commutative61.0%
associate-*r/61.0%
associate-*l/61.0%
*-commutative61.0%
*-commutative61.0%
Simplified61.0%
if -2.8000000000000001e-37 < z < 3e36Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
associate-*r*96.2%
*-commutative96.2%
associate-+l-96.2%
Simplified95.4%
Taylor expanded in b around inf 53.9%
*-commutative53.9%
Simplified53.9%
div-inv54.6%
associate-/r*54.5%
Applied egg-rr54.5%
Taylor expanded in z around 0 54.6%
associate-/r*54.6%
Simplified54.6%
if 3e36 < z Initial program 61.0%
associate-+l-61.0%
*-commutative61.0%
associate-*r*63.0%
*-commutative63.0%
associate-+l-63.0%
Simplified72.6%
div-inv72.5%
associate-+l-72.5%
associate-*r*60.9%
associate-+l-60.9%
associate-*l*61.0%
associate-*r*72.5%
Applied egg-rr72.5%
Taylor expanded in z around inf 56.6%
associate-*l/59.6%
*-commutative59.6%
*-commutative59.6%
associate-*l*59.6%
Simplified59.6%
Final simplification57.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.1e+256)
(/ b (* z c))
(if (<= z -4e-37)
(* (/ (* a t) c) -4.0)
(if (<= z 5.8e+36) (* b (/ (/ 1.0 c) z)) (* t (* -4.0 (/ a c)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -4e-37) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= 5.8e+36) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-1.1d+256)) then
tmp = b / (z * c)
else if (z <= (-4d-37)) then
tmp = ((a * t) / c) * (-4.0d0)
else if (z <= 5.8d+36) then
tmp = b * ((1.0d0 / c) / z)
else
tmp = t * ((-4.0d0) * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.1e+256) {
tmp = b / (z * c);
} else if (z <= -4e-37) {
tmp = ((a * t) / c) * -4.0;
} else if (z <= 5.8e+36) {
tmp = b * ((1.0 / c) / z);
} else {
tmp = t * (-4.0 * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.1e+256: tmp = b / (z * c) elif z <= -4e-37: tmp = ((a * t) / c) * -4.0 elif z <= 5.8e+36: tmp = b * ((1.0 / c) / z) else: tmp = t * (-4.0 * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.1e+256) tmp = Float64(b / Float64(z * c)); elseif (z <= -4e-37) tmp = Float64(Float64(Float64(a * t) / c) * -4.0); elseif (z <= 5.8e+36) tmp = Float64(b * Float64(Float64(1.0 / c) / z)); else tmp = Float64(t * Float64(-4.0 * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -1.1e+256)
tmp = b / (z * c);
elseif (z <= -4e-37)
tmp = ((a * t) / c) * -4.0;
elseif (z <= 5.8e+36)
tmp = b * ((1.0 / c) / z);
else
tmp = t * (-4.0 * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.1e+256], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4e-37], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 5.8e+36], N[(b * N[(N[(1.0 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+256}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-37}:\\
\;\;\;\;\frac{a \cdot t}{c} \cdot -4\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+36}:\\
\;\;\;\;b \cdot \frac{\frac{1}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -1.1e256Initial program 50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*59.1%
*-commutative59.1%
associate-+l-59.1%
Simplified67.4%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
if -1.1e256 < z < -4.00000000000000027e-37Initial program 65.7%
associate-+l-65.7%
*-commutative65.7%
associate-*r*70.6%
*-commutative70.6%
associate-+l-70.6%
Simplified70.7%
Taylor expanded in z around inf 61.0%
*-commutative61.0%
Simplified61.0%
if -4.00000000000000027e-37 < z < 5.8e36Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
associate-*r*96.2%
*-commutative96.2%
associate-+l-96.2%
Simplified95.4%
Taylor expanded in b around inf 53.9%
*-commutative53.9%
Simplified53.9%
div-inv54.6%
associate-/r*54.5%
Applied egg-rr54.5%
Taylor expanded in z around 0 54.6%
associate-/r*54.6%
Simplified54.6%
if 5.8e36 < z Initial program 61.0%
associate-+l-61.0%
*-commutative61.0%
associate-*r*63.0%
*-commutative63.0%
associate-+l-63.0%
Simplified72.6%
div-inv72.5%
associate-+l-72.5%
associate-*r*60.9%
associate-+l-60.9%
associate-*l*61.0%
associate-*r*72.5%
Applied egg-rr72.5%
Taylor expanded in z around inf 56.6%
associate-*l/59.6%
*-commutative59.6%
*-commutative59.6%
associate-*l*59.6%
Simplified59.6%
Final simplification57.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -6.5e-39) (not (<= z 3.6e+36))) (* t (* -4.0 (/ a c))) (* b (/ (/ 1.0 c) z))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -6.5e-39) || !(z <= 3.6e+36)) {
tmp = t * (-4.0 * (a / c));
} else {
tmp = b * ((1.0 / c) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-6.5d-39)) .or. (.not. (z <= 3.6d+36))) then
tmp = t * ((-4.0d0) * (a / c))
else
tmp = b * ((1.0d0 / c) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -6.5e-39) || !(z <= 3.6e+36)) {
tmp = t * (-4.0 * (a / c));
} else {
tmp = b * ((1.0 / c) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -6.5e-39) or not (z <= 3.6e+36): tmp = t * (-4.0 * (a / c)) else: tmp = b * ((1.0 / c) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -6.5e-39) || !(z <= 3.6e+36)) tmp = Float64(t * Float64(-4.0 * Float64(a / c))); else tmp = Float64(b * Float64(Float64(1.0 / c) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -6.5e-39) || ~((z <= 3.6e+36)))
tmp = t * (-4.0 * (a / c));
else
tmp = b * ((1.0 / c) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -6.5e-39], N[Not[LessEqual[z, 3.6e+36]], $MachinePrecision]], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(1.0 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-39} \lor \neg \left(z \leq 3.6 \cdot 10^{+36}\right):\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{\frac{1}{c}}{z}\\
\end{array}
\end{array}
if z < -6.50000000000000027e-39 or 3.5999999999999997e36 < z Initial program 62.3%
associate-+l-62.3%
*-commutative62.3%
associate-*r*66.3%
*-commutative66.3%
associate-+l-66.3%
Simplified71.2%
div-inv71.1%
associate-+l-71.1%
associate-*r*62.3%
associate-+l-62.3%
associate-*l*62.3%
associate-*r*71.1%
Applied egg-rr71.1%
Taylor expanded in z around inf 55.9%
associate-*l/55.5%
*-commutative55.5%
*-commutative55.5%
associate-*l*55.5%
Simplified55.5%
if -6.50000000000000027e-39 < z < 3.5999999999999997e36Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
associate-*r*96.2%
*-commutative96.2%
associate-+l-96.2%
Simplified95.4%
Taylor expanded in b around inf 53.9%
*-commutative53.9%
Simplified53.9%
div-inv54.6%
associate-/r*54.5%
Applied egg-rr54.5%
Taylor expanded in z around 0 54.6%
associate-/r*54.6%
Simplified54.6%
Final simplification55.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (* b (/ (/ 1.0 c) z)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b * ((1.0 / c) / z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b * ((1.0d0 / c) / z)
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b * ((1.0 / c) / z);
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): return b * ((1.0 / c) / z)
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) return Float64(b * Float64(Float64(1.0 / c) / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b * ((1.0 / c) / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b * N[(N[(1.0 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
b \cdot \frac{\frac{1}{c}}{z}
\end{array}
Initial program 80.9%
associate-+l-80.9%
*-commutative80.9%
associate-*r*82.1%
*-commutative82.1%
associate-+l-82.1%
Simplified84.0%
Taylor expanded in b around inf 38.6%
*-commutative38.6%
Simplified38.6%
div-inv39.0%
associate-/r*38.9%
Applied egg-rr38.9%
Taylor expanded in z around 0 39.0%
associate-/r*39.0%
Simplified39.0%
Final simplification39.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b / (z * c)
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 80.9%
associate-+l-80.9%
*-commutative80.9%
associate-*r*82.1%
*-commutative82.1%
associate-+l-82.1%
Simplified84.0%
Taylor expanded in b around inf 38.6%
*-commutative38.6%
Simplified38.6%
Final simplification38.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 2023287
(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)))