
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -6.6e+35)
(* (fma -4.0 (* a t) (fma 9.0 (/ x (/ z y)) (/ b z))) (/ 1.0 c))
(if (<= z 5e-120)
(* (/ 1.0 z) (/ (fma x (* 9.0 y) (+ b (* t (* z (* -4.0 a))))) c))
(* (/ 1.0 c) (+ (* -4.0 (* a t)) (+ (/ b z) (* 9.0 (/ (* x y) z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -6.6e+35) {
tmp = fma(-4.0, (a * t), fma(9.0, (x / (z / y)), (b / z))) * (1.0 / c);
} else if (z <= 5e-120) {
tmp = (1.0 / z) * (fma(x, (9.0 * y), (b + (t * (z * (-4.0 * a))))) / c);
} else {
tmp = (1.0 / c) * ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((x * y) / z))));
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -6.6e+35) tmp = Float64(fma(-4.0, Float64(a * t), fma(9.0, Float64(x / Float64(z / y)), Float64(b / z))) * Float64(1.0 / c)); elseif (z <= 5e-120) tmp = Float64(Float64(1.0 / z) * Float64(fma(x, Float64(9.0 * y), Float64(b + Float64(t * Float64(z * Float64(-4.0 * a))))) / c)); else tmp = Float64(Float64(1.0 / c) * Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(x * y) / z))))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -6.6e+35], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(9.0 * N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-120], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(b + N[(t * N[(z * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / c), $MachinePrecision] * N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x}{\frac{z}{y}}, \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-120}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\mathsf{fma}\left(x, 9 \cdot y, b + t \cdot \left(z \cdot \left(-4 \cdot a\right)\right)\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{c} \cdot \left(-4 \cdot \left(a \cdot t\right) + \left(\frac{b}{z} + 9 \cdot \frac{x \cdot y}{z}\right)\right)\\
\end{array}
\end{array}
if z < -6.6000000000000003e35Initial program 63.3%
associate-/r*70.0%
associate-+l-70.0%
associate-*r*70.0%
associate-*r*82.7%
div-inv82.5%
associate--r-82.5%
fma-neg82.5%
associate-*r*69.8%
distribute-rgt-neg-in69.8%
associate-*l*69.8%
Applied egg-rr69.8%
Taylor expanded in x around 0 87.2%
fma-def87.2%
fma-def87.2%
associate-/l*91.8%
Simplified91.8%
if -6.6000000000000003e35 < z < 5.00000000000000007e-120Initial program 96.5%
Simplified96.5%
*-un-lft-identity96.5%
times-frac97.9%
+-commutative97.9%
fma-def97.9%
Applied egg-rr97.9%
fma-udef97.9%
Applied egg-rr97.9%
if 5.00000000000000007e-120 < z Initial program 66.3%
associate-/r*77.1%
associate-+l-77.1%
associate-*r*79.3%
associate-*r*83.6%
div-inv83.5%
associate--r-83.5%
fma-neg83.5%
associate-*r*79.2%
distribute-rgt-neg-in79.2%
associate-*l*79.2%
Applied egg-rr79.2%
Taylor expanded in x around 0 95.3%
Final simplification95.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 (* y (* 9.0 x))))
(if (<= t_1 (- INFINITY))
(* x (/ (* y (/ 9.0 c)) z))
(if (<= t_1 1e+173)
(* (/ 1.0 c) (+ (* -4.0 (* a t)) (+ (/ b z) (* 9.0 (/ (* x y) z)))))
(/ (* 9.0 y) (* c (/ z x)))))))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 * (9.0 * x);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x * ((y * (9.0 / c)) / z);
} else if (t_1 <= 1e+173) {
tmp = (1.0 / c) * ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((x * y) / z))));
} else {
tmp = (9.0 * y) / (c * (z / x));
}
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 * (9.0 * x);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x * ((y * (9.0 / c)) / z);
} else if (t_1 <= 1e+173) {
tmp = (1.0 / c) * ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((x * y) / z))));
} else {
tmp = (9.0 * y) / (c * (z / x));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = y * (9.0 * x) tmp = 0 if t_1 <= -math.inf: tmp = x * ((y * (9.0 / c)) / z) elif t_1 <= 1e+173: tmp = (1.0 / c) * ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((x * y) / z)))) else: tmp = (9.0 * y) / (c * (z / x)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(9.0 * x)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y * Float64(9.0 / c)) / z)); elseif (t_1 <= 1e+173) tmp = Float64(Float64(1.0 / c) * Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(x * y) / z))))); else tmp = Float64(Float64(9.0 * y) / Float64(c * Float64(z / x))); 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 * (9.0 * x);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = x * ((y * (9.0 / c)) / z);
elseif (t_1 <= 1e+173)
tmp = (1.0 / c) * ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((x * y) / z))));
else
tmp = (9.0 * y) / (c * (z / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x * N[(N[(y * N[(9.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+173], N[(N[(1.0 / c), $MachinePrecision] * N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(9.0 * y), $MachinePrecision] / N[(c * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(9 \cdot x\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y \cdot \frac{9}{c}}{z}\\
\mathbf{elif}\;t_1 \leq 10^{+173}:\\
\;\;\;\;\frac{1}{c} \cdot \left(-4 \cdot \left(a \cdot t\right) + \left(\frac{b}{z} + 9 \cdot \frac{x \cdot y}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{9 \cdot y}{c \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -inf.0Initial program 64.3%
Simplified74.5%
*-un-lft-identity74.5%
times-frac74.8%
+-commutative74.8%
fma-def74.8%
Applied egg-rr74.8%
Taylor expanded in x around inf 79.8%
associate-*r/79.8%
*-commutative79.8%
associate-*l*79.8%
times-frac90.1%
associate-/l*90.1%
associate-*r/85.0%
associate-*l/95.0%
associate-/r/95.1%
Simplified95.1%
if -inf.0 < (*.f64 (*.f64 x 9) y) < 1e173Initial program 80.1%
associate-/r*84.2%
associate-+l-84.2%
associate-*r*84.2%
associate-*r*89.1%
div-inv88.9%
associate--r-88.9%
fma-neg88.9%
associate-*r*84.1%
distribute-rgt-neg-in84.1%
associate-*l*84.1%
Applied egg-rr84.1%
Taylor expanded in x around 0 95.0%
if 1e173 < (*.f64 (*.f64 x 9) y) Initial program 73.6%
associate-/r*71.0%
associate-+l-71.0%
associate-*r*73.9%
associate-*r*70.9%
div-inv70.8%
associate--r-70.8%
fma-neg70.8%
associate-*r*73.9%
distribute-rgt-neg-in73.9%
associate-*l*73.9%
Applied egg-rr73.9%
Taylor expanded in x around inf 73.7%
*-commutative73.7%
*-commutative73.7%
times-frac91.2%
associate-*l*91.1%
Simplified91.1%
clear-num91.0%
associate-*l/90.9%
*-commutative90.9%
frac-times93.9%
*-un-lft-identity93.9%
Applied egg-rr93.9%
Final simplification94.9%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a t))))
(if (<= y -2.1e+59)
(* 9.0 (* (/ x z) (/ y c)))
(if (<= y -1.15e-144)
(/ (+ t_1 (* 9.0 (/ (* x y) z))) c)
(if (<= y 6e+74)
(/ (+ (/ b z) t_1) c)
(* (/ 1.0 c) (+ t_1 (* (* 9.0 y) (/ x z)))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * t);
double tmp;
if (y <= -2.1e+59) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (y <= -1.15e-144) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else if (y <= 6e+74) {
tmp = ((b / z) + t_1) / c;
} else {
tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
if (y <= (-2.1d+59)) then
tmp = 9.0d0 * ((x / z) * (y / c))
else if (y <= (-1.15d-144)) then
tmp = (t_1 + (9.0d0 * ((x * y) / z))) / c
else if (y <= 6d+74) then
tmp = ((b / z) + t_1) / c
else
tmp = (1.0d0 / c) * (t_1 + ((9.0d0 * y) * (x / z)))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * t);
double tmp;
if (y <= -2.1e+59) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (y <= -1.15e-144) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else if (y <= 6e+74) {
tmp = ((b / z) + t_1) / c;
} else {
tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z)));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * t) tmp = 0 if y <= -2.1e+59: tmp = 9.0 * ((x / z) * (y / c)) elif y <= -1.15e-144: tmp = (t_1 + (9.0 * ((x * y) / z))) / c elif y <= 6e+74: tmp = ((b / z) + t_1) / c else: tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (y <= -2.1e+59) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); elseif (y <= -1.15e-144) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(x * y) / z))) / c); elseif (y <= 6e+74) tmp = Float64(Float64(Float64(b / z) + t_1) / c); else tmp = Float64(Float64(1.0 / c) * Float64(t_1 + Float64(Float64(9.0 * y) * Float64(x / z)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * t);
tmp = 0.0;
if (y <= -2.1e+59)
tmp = 9.0 * ((x / z) * (y / c));
elseif (y <= -1.15e-144)
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
elseif (y <= 6e+74)
tmp = ((b / z) + t_1) / c;
else
tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+59], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.15e-144], N[(N[(t$95$1 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 6e+74], N[(N[(N[(b / z), $MachinePrecision] + t$95$1), $MachinePrecision] / c), $MachinePrecision], N[(N[(1.0 / c), $MachinePrecision] * N[(t$95$1 + N[(N[(9.0 * y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+59}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-144}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{b}{z} + t_1}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{c} \cdot \left(t_1 + \left(9 \cdot y\right) \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if y < -2.09999999999999984e59Initial program 83.1%
Taylor expanded in x around inf 53.4%
*-commutative53.4%
Simplified53.4%
Taylor expanded in x around 0 53.4%
*-commutative53.4%
times-frac59.6%
Simplified59.6%
if -2.09999999999999984e59 < y < -1.15e-144Initial program 76.9%
associate-/r*86.4%
associate-+l-86.4%
associate-*r*86.4%
associate-*r*88.5%
div-inv88.3%
associate--r-88.3%
fma-neg88.3%
associate-*r*86.4%
distribute-rgt-neg-in86.4%
associate-*l*86.4%
Applied egg-rr86.4%
Taylor expanded in x around 0 94.0%
Taylor expanded in b around 0 70.6%
if -1.15e-144 < y < 6e74Initial program 79.2%
associate-/r*82.3%
associate-+l-82.3%
associate-*r*84.0%
associate-*r*90.3%
div-inv90.2%
associate--r-90.2%
fma-neg90.2%
associate-*r*83.9%
distribute-rgt-neg-in83.9%
associate-*l*83.9%
Applied egg-rr83.9%
Taylor expanded in x around 0 94.5%
Taylor expanded in x around 0 79.9%
if 6e74 < y Initial program 72.1%
associate-/r*72.4%
associate-+l-72.4%
associate-*r*72.5%
associate-*r*78.4%
div-inv78.4%
associate--r-78.4%
fma-neg78.4%
associate-*r*72.4%
distribute-rgt-neg-in72.4%
associate-*l*72.4%
Applied egg-rr72.4%
Taylor expanded in x around 0 82.3%
Taylor expanded in x around inf 77.2%
*-commutative77.2%
associate-*r/79.1%
associate-*r*79.1%
Simplified79.1%
Final simplification74.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a t))))
(if (<= z -4.1e+186)
(* (/ 1.0 c) (+ t_1 (* (* 9.0 y) (/ x z))))
(if (<= z 9.5e+116)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))
(/ (+ (/ b z) t_1) 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 = -4.0 * (a * t);
double tmp;
if (z <= -4.1e+186) {
tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z)));
} else if (z <= 9.5e+116) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / z) + t_1) / 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) :: tmp
t_1 = (-4.0d0) * (a * t)
if (z <= (-4.1d+186)) then
tmp = (1.0d0 / c) * (t_1 + ((9.0d0 * y) * (x / z)))
else if (z <= 9.5d+116) then
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = ((b / z) + t_1) / 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 = -4.0 * (a * t);
double tmp;
if (z <= -4.1e+186) {
tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z)));
} else if (z <= 9.5e+116) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / z) + t_1) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * t) tmp = 0 if z <= -4.1e+186: tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z))) elif z <= 9.5e+116: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = ((b / z) + t_1) / 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(-4.0 * Float64(a * t)) tmp = 0.0 if (z <= -4.1e+186) tmp = Float64(Float64(1.0 / c) * Float64(t_1 + Float64(Float64(9.0 * y) * Float64(x / z)))); elseif (z <= 9.5e+116) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / z) + t_1) / 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 = -4.0 * (a * t);
tmp = 0.0;
if (z <= -4.1e+186)
tmp = (1.0 / c) * (t_1 + ((9.0 * y) * (x / z)));
elseif (z <= 9.5e+116)
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = ((b / z) + t_1) / 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[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+186], N[(N[(1.0 / c), $MachinePrecision] * N[(t$95$1 + N[(N[(9.0 * y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+116], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] + t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+186}:\\
\;\;\;\;\frac{1}{c} \cdot \left(t_1 + \left(9 \cdot y\right) \cdot \frac{x}{z}\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+116}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} + t_1}{c}\\
\end{array}
\end{array}
if z < -4.1e186Initial program 41.0%
associate-/r*45.1%
associate-+l-45.1%
associate-*r*45.1%
associate-*r*72.7%
div-inv72.6%
associate--r-72.6%
fma-neg72.6%
associate-*r*45.2%
distribute-rgt-neg-in45.2%
associate-*l*45.2%
Applied egg-rr45.2%
Taylor expanded in x around 0 82.9%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r/86.2%
associate-*r*86.3%
Simplified86.3%
if -4.1e186 < z < 9.5000000000000004e116Initial program 90.2%
if 9.5000000000000004e116 < z Initial program 46.9%
associate-/r*66.1%
associate-+l-66.1%
associate-*r*68.6%
associate-*r*78.3%
div-inv78.0%
associate--r-78.0%
fma-neg78.0%
associate-*r*68.4%
distribute-rgt-neg-in68.4%
associate-*l*68.4%
Applied egg-rr68.4%
Taylor expanded in x around 0 99.5%
Taylor expanded in x around 0 86.3%
Final simplification89.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ a (/ c t))))
(t_2 (* 9.0 (* (/ x z) (/ y c))))
(t_3 (/ (/ b c) z)))
(if (<= y -1.1e-113)
t_2
(if (<= y -4.5e-220)
(* -4.0 (/ (* a t) c))
(if (<= y 1.05e-307)
t_3
(if (<= y 8.2e-251)
t_1
(if (<= y 1.1e-59) t_3 (if (<= y 2.1e+88) t_1 t_2))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a / (c / t));
double t_2 = 9.0 * ((x / z) * (y / c));
double t_3 = (b / c) / z;
double tmp;
if (y <= -1.1e-113) {
tmp = t_2;
} else if (y <= -4.5e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= 1.05e-307) {
tmp = t_3;
} else if (y <= 8.2e-251) {
tmp = t_1;
} else if (y <= 1.1e-59) {
tmp = t_3;
} else if (y <= 2.1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * (a / (c / t))
t_2 = 9.0d0 * ((x / z) * (y / c))
t_3 = (b / c) / z
if (y <= (-1.1d-113)) then
tmp = t_2
else if (y <= (-4.5d-220)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (y <= 1.05d-307) then
tmp = t_3
else if (y <= 8.2d-251) then
tmp = t_1
else if (y <= 1.1d-59) then
tmp = t_3
else if (y <= 2.1d+88) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a / (c / t));
double t_2 = 9.0 * ((x / z) * (y / c));
double t_3 = (b / c) / z;
double tmp;
if (y <= -1.1e-113) {
tmp = t_2;
} else if (y <= -4.5e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= 1.05e-307) {
tmp = t_3;
} else if (y <= 8.2e-251) {
tmp = t_1;
} else if (y <= 1.1e-59) {
tmp = t_3;
} else if (y <= 2.1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a / (c / t)) t_2 = 9.0 * ((x / z) * (y / c)) t_3 = (b / c) / z tmp = 0 if y <= -1.1e-113: tmp = t_2 elif y <= -4.5e-220: tmp = -4.0 * ((a * t) / c) elif y <= 1.05e-307: tmp = t_3 elif y <= 8.2e-251: tmp = t_1 elif y <= 1.1e-59: tmp = t_3 elif y <= 2.1e+88: tmp = t_1 else: tmp = t_2 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a / Float64(c / t))) t_2 = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))) t_3 = Float64(Float64(b / c) / z) tmp = 0.0 if (y <= -1.1e-113) tmp = t_2; elseif (y <= -4.5e-220) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (y <= 1.05e-307) tmp = t_3; elseif (y <= 8.2e-251) tmp = t_1; elseif (y <= 1.1e-59) tmp = t_3; elseif (y <= 2.1e+88) tmp = t_1; else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a / (c / t));
t_2 = 9.0 * ((x / z) * (y / c));
t_3 = (b / c) / z;
tmp = 0.0;
if (y <= -1.1e-113)
tmp = t_2;
elseif (y <= -4.5e-220)
tmp = -4.0 * ((a * t) / c);
elseif (y <= 1.05e-307)
tmp = t_3;
elseif (y <= 8.2e-251)
tmp = t_1;
elseif (y <= 1.1e-59)
tmp = t_3;
elseif (y <= 2.1e+88)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.1e-113], t$95$2, If[LessEqual[y, -4.5e-220], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-307], t$95$3, If[LessEqual[y, 8.2e-251], t$95$1, If[LessEqual[y, 1.1e-59], t$95$3, If[LessEqual[y, 2.1e+88], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a}{\frac{c}{t}}\\
t_2 := 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
t_3 := \frac{\frac{b}{c}}{z}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-113}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-220}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-307}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-59}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.10000000000000002e-113 or 2.1e88 < y Initial program 79.3%
Taylor expanded in x around inf 48.7%
*-commutative48.7%
Simplified48.7%
Taylor expanded in x around 0 48.7%
*-commutative48.7%
times-frac53.1%
Simplified53.1%
if -1.10000000000000002e-113 < y < -4.49999999999999967e-220Initial program 60.3%
Taylor expanded in z around inf 51.7%
if -4.49999999999999967e-220 < y < 1.0500000000000001e-307 or 8.1999999999999997e-251 < y < 1.0999999999999999e-59Initial program 88.2%
Simplified95.7%
*-un-lft-identity95.7%
times-frac90.0%
+-commutative90.0%
fma-def90.0%
Applied egg-rr90.0%
Taylor expanded in b around inf 47.2%
associate-/r*51.6%
Simplified51.6%
if 1.0500000000000001e-307 < y < 8.1999999999999997e-251 or 1.0999999999999999e-59 < y < 2.1e88Initial program 76.8%
Taylor expanded in z around inf 53.0%
*-commutative53.0%
associate-/l*48.4%
Simplified48.4%
Final simplification51.9%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ a (/ c t)))) (t_2 (/ (/ b c) z)))
(if (<= y -1.1e-113)
(* 9.0 (* (/ x z) (/ y c)))
(if (<= y -3.2e-220)
(* -4.0 (/ (* a t) c))
(if (<= y 6.1e-307)
t_2
(if (<= y 4.2e-253)
t_1
(if (<= y 4.2e-62)
t_2
(if (<= y 2.5e+83) t_1 (* (/ x z) (* 9.0 (/ y 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 = -4.0 * (a / (c / t));
double t_2 = (b / c) / z;
double tmp;
if (y <= -1.1e-113) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (y <= -3.2e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= 6.1e-307) {
tmp = t_2;
} else if (y <= 4.2e-253) {
tmp = t_1;
} else if (y <= 4.2e-62) {
tmp = t_2;
} else if (y <= 2.5e+83) {
tmp = t_1;
} else {
tmp = (x / z) * (9.0 * (y / 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 = (-4.0d0) * (a / (c / t))
t_2 = (b / c) / z
if (y <= (-1.1d-113)) then
tmp = 9.0d0 * ((x / z) * (y / c))
else if (y <= (-3.2d-220)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (y <= 6.1d-307) then
tmp = t_2
else if (y <= 4.2d-253) then
tmp = t_1
else if (y <= 4.2d-62) then
tmp = t_2
else if (y <= 2.5d+83) then
tmp = t_1
else
tmp = (x / z) * (9.0d0 * (y / 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 = -4.0 * (a / (c / t));
double t_2 = (b / c) / z;
double tmp;
if (y <= -1.1e-113) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (y <= -3.2e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= 6.1e-307) {
tmp = t_2;
} else if (y <= 4.2e-253) {
tmp = t_1;
} else if (y <= 4.2e-62) {
tmp = t_2;
} else if (y <= 2.5e+83) {
tmp = t_1;
} else {
tmp = (x / z) * (9.0 * (y / c));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a / (c / t)) t_2 = (b / c) / z tmp = 0 if y <= -1.1e-113: tmp = 9.0 * ((x / z) * (y / c)) elif y <= -3.2e-220: tmp = -4.0 * ((a * t) / c) elif y <= 6.1e-307: tmp = t_2 elif y <= 4.2e-253: tmp = t_1 elif y <= 4.2e-62: tmp = t_2 elif y <= 2.5e+83: tmp = t_1 else: tmp = (x / z) * (9.0 * (y / 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(-4.0 * Float64(a / Float64(c / t))) t_2 = Float64(Float64(b / c) / z) tmp = 0.0 if (y <= -1.1e-113) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); elseif (y <= -3.2e-220) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (y <= 6.1e-307) tmp = t_2; elseif (y <= 4.2e-253) tmp = t_1; elseif (y <= 4.2e-62) tmp = t_2; elseif (y <= 2.5e+83) tmp = t_1; else tmp = Float64(Float64(x / z) * Float64(9.0 * Float64(y / 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 = -4.0 * (a / (c / t));
t_2 = (b / c) / z;
tmp = 0.0;
if (y <= -1.1e-113)
tmp = 9.0 * ((x / z) * (y / c));
elseif (y <= -3.2e-220)
tmp = -4.0 * ((a * t) / c);
elseif (y <= 6.1e-307)
tmp = t_2;
elseif (y <= 4.2e-253)
tmp = t_1;
elseif (y <= 4.2e-62)
tmp = t_2;
elseif (y <= 2.5e+83)
tmp = t_1;
else
tmp = (x / z) * (9.0 * (y / 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[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.1e-113], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.2e-220], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.1e-307], t$95$2, If[LessEqual[y, 4.2e-253], t$95$1, If[LessEqual[y, 4.2e-62], t$95$2, If[LessEqual[y, 2.5e+83], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a}{\frac{c}{t}}\\
t_2 := \frac{\frac{b}{c}}{z}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-113}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-220}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-307}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-253}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(9 \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if y < -1.10000000000000002e-113Initial program 81.9%
Taylor expanded in x around inf 43.4%
*-commutative43.4%
Simplified43.4%
Taylor expanded in x around 0 43.4%
*-commutative43.4%
times-frac44.6%
Simplified44.6%
if -1.10000000000000002e-113 < y < -3.20000000000000005e-220Initial program 60.3%
Taylor expanded in z around inf 51.7%
if -3.20000000000000005e-220 < y < 6.09999999999999974e-307 or 4.1999999999999998e-253 < y < 4.1999999999999998e-62Initial program 88.2%
Simplified95.7%
*-un-lft-identity95.7%
times-frac90.0%
+-commutative90.0%
fma-def90.0%
Applied egg-rr90.0%
Taylor expanded in b around inf 49.2%
associate-/r*53.7%
Simplified53.7%
if 6.09999999999999974e-307 < y < 4.1999999999999998e-253 or 4.1999999999999998e-62 < y < 2.50000000000000014e83Initial program 76.8%
Taylor expanded in z around inf 50.6%
*-commutative50.6%
associate-/l*46.0%
Simplified46.0%
if 2.50000000000000014e83 < y Initial program 74.5%
associate-/r*74.8%
associate-+l-74.8%
associate-*r*74.9%
associate-*r*79.1%
div-inv79.0%
associate--r-79.0%
fma-neg79.0%
associate-*r*74.8%
distribute-rgt-neg-in74.8%
associate-*l*74.8%
Applied egg-rr74.8%
Taylor expanded in x around inf 58.5%
*-commutative58.5%
*-commutative58.5%
times-frac69.0%
associate-*l*69.0%
Simplified69.0%
Final simplification51.9%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ a (/ c t)))) (t_2 (/ (/ b c) z)))
(if (<= y -1.1e-113)
(* x (/ (* y (/ 9.0 c)) z))
(if (<= y -2.45e-220)
(* -4.0 (/ (* a t) c))
(if (<= y -2.05e-307)
t_2
(if (<= y 2.4e-251)
t_1
(if (<= y 1.45e-59)
t_2
(if (<= y 7.3e+84) t_1 (* (/ x z) (* 9.0 (/ y 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 = -4.0 * (a / (c / t));
double t_2 = (b / c) / z;
double tmp;
if (y <= -1.1e-113) {
tmp = x * ((y * (9.0 / c)) / z);
} else if (y <= -2.45e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= -2.05e-307) {
tmp = t_2;
} else if (y <= 2.4e-251) {
tmp = t_1;
} else if (y <= 1.45e-59) {
tmp = t_2;
} else if (y <= 7.3e+84) {
tmp = t_1;
} else {
tmp = (x / z) * (9.0 * (y / 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 = (-4.0d0) * (a / (c / t))
t_2 = (b / c) / z
if (y <= (-1.1d-113)) then
tmp = x * ((y * (9.0d0 / c)) / z)
else if (y <= (-2.45d-220)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (y <= (-2.05d-307)) then
tmp = t_2
else if (y <= 2.4d-251) then
tmp = t_1
else if (y <= 1.45d-59) then
tmp = t_2
else if (y <= 7.3d+84) then
tmp = t_1
else
tmp = (x / z) * (9.0d0 * (y / 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 = -4.0 * (a / (c / t));
double t_2 = (b / c) / z;
double tmp;
if (y <= -1.1e-113) {
tmp = x * ((y * (9.0 / c)) / z);
} else if (y <= -2.45e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= -2.05e-307) {
tmp = t_2;
} else if (y <= 2.4e-251) {
tmp = t_1;
} else if (y <= 1.45e-59) {
tmp = t_2;
} else if (y <= 7.3e+84) {
tmp = t_1;
} else {
tmp = (x / z) * (9.0 * (y / c));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a / (c / t)) t_2 = (b / c) / z tmp = 0 if y <= -1.1e-113: tmp = x * ((y * (9.0 / c)) / z) elif y <= -2.45e-220: tmp = -4.0 * ((a * t) / c) elif y <= -2.05e-307: tmp = t_2 elif y <= 2.4e-251: tmp = t_1 elif y <= 1.45e-59: tmp = t_2 elif y <= 7.3e+84: tmp = t_1 else: tmp = (x / z) * (9.0 * (y / 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(-4.0 * Float64(a / Float64(c / t))) t_2 = Float64(Float64(b / c) / z) tmp = 0.0 if (y <= -1.1e-113) tmp = Float64(x * Float64(Float64(y * Float64(9.0 / c)) / z)); elseif (y <= -2.45e-220) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (y <= -2.05e-307) tmp = t_2; elseif (y <= 2.4e-251) tmp = t_1; elseif (y <= 1.45e-59) tmp = t_2; elseif (y <= 7.3e+84) tmp = t_1; else tmp = Float64(Float64(x / z) * Float64(9.0 * Float64(y / 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 = -4.0 * (a / (c / t));
t_2 = (b / c) / z;
tmp = 0.0;
if (y <= -1.1e-113)
tmp = x * ((y * (9.0 / c)) / z);
elseif (y <= -2.45e-220)
tmp = -4.0 * ((a * t) / c);
elseif (y <= -2.05e-307)
tmp = t_2;
elseif (y <= 2.4e-251)
tmp = t_1;
elseif (y <= 1.45e-59)
tmp = t_2;
elseif (y <= 7.3e+84)
tmp = t_1;
else
tmp = (x / z) * (9.0 * (y / 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[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.1e-113], N[(x * N[(N[(y * N[(9.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.45e-220], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.05e-307], t$95$2, If[LessEqual[y, 2.4e-251], t$95$1, If[LessEqual[y, 1.45e-59], t$95$2, If[LessEqual[y, 7.3e+84], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a}{\frac{c}{t}}\\
t_2 := \frac{\frac{b}{c}}{z}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-113}:\\
\;\;\;\;x \cdot \frac{y \cdot \frac{9}{c}}{z}\\
\mathbf{elif}\;y \leq -2.45 \cdot 10^{-220}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-307}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.3 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(9 \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if y < -1.10000000000000002e-113Initial program 81.9%
Simplified78.4%
*-un-lft-identity78.4%
times-frac77.6%
+-commutative77.6%
fma-def77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 43.4%
associate-*r/43.4%
*-commutative43.4%
associate-*l*43.4%
times-frac43.4%
associate-/l*43.4%
associate-*r/44.6%
associate-*l/44.4%
associate-/r/44.4%
Simplified44.4%
if -1.10000000000000002e-113 < y < -2.4500000000000001e-220Initial program 60.3%
Taylor expanded in z around inf 51.7%
if -2.4500000000000001e-220 < y < -2.05000000000000016e-307 or 2.39999999999999996e-251 < y < 1.45000000000000008e-59Initial program 88.4%
Simplified95.8%
*-un-lft-identity95.8%
times-frac90.2%
+-commutative90.2%
fma-def90.2%
Applied egg-rr90.2%
Taylor expanded in b around inf 48.2%
associate-/r*52.6%
Simplified52.6%
if -2.05000000000000016e-307 < y < 2.39999999999999996e-251 or 1.45000000000000008e-59 < y < 7.3e84Initial program 76.2%
Taylor expanded in z around inf 51.8%
*-commutative51.8%
associate-/l*47.1%
Simplified47.1%
if 7.3e84 < y Initial program 74.5%
associate-/r*74.8%
associate-+l-74.8%
associate-*r*74.9%
associate-*r*79.1%
div-inv79.0%
associate--r-79.0%
fma-neg79.0%
associate-*r*74.8%
distribute-rgt-neg-in74.8%
associate-*l*74.8%
Applied egg-rr74.8%
Taylor expanded in x around inf 58.5%
*-commutative58.5%
*-commutative58.5%
times-frac69.0%
associate-*l*69.0%
Simplified69.0%
Final simplification51.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 (* -4.0 (/ a (/ c t)))) (t_2 (/ (/ b c) z)))
(if (<= y -1.75e-133)
(/ (* 9.0 y) (* c (/ z x)))
(if (<= y -2.8e-220)
(* -4.0 (/ (* a t) c))
(if (<= y -3.05e-307)
t_2
(if (<= y 9.8e-253)
t_1
(if (<= y 2.25e-63)
t_2
(if (<= y 6.2e+83) t_1 (* (/ x z) (* 9.0 (/ y 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 = -4.0 * (a / (c / t));
double t_2 = (b / c) / z;
double tmp;
if (y <= -1.75e-133) {
tmp = (9.0 * y) / (c * (z / x));
} else if (y <= -2.8e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= -3.05e-307) {
tmp = t_2;
} else if (y <= 9.8e-253) {
tmp = t_1;
} else if (y <= 2.25e-63) {
tmp = t_2;
} else if (y <= 6.2e+83) {
tmp = t_1;
} else {
tmp = (x / z) * (9.0 * (y / 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 = (-4.0d0) * (a / (c / t))
t_2 = (b / c) / z
if (y <= (-1.75d-133)) then
tmp = (9.0d0 * y) / (c * (z / x))
else if (y <= (-2.8d-220)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (y <= (-3.05d-307)) then
tmp = t_2
else if (y <= 9.8d-253) then
tmp = t_1
else if (y <= 2.25d-63) then
tmp = t_2
else if (y <= 6.2d+83) then
tmp = t_1
else
tmp = (x / z) * (9.0d0 * (y / 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 = -4.0 * (a / (c / t));
double t_2 = (b / c) / z;
double tmp;
if (y <= -1.75e-133) {
tmp = (9.0 * y) / (c * (z / x));
} else if (y <= -2.8e-220) {
tmp = -4.0 * ((a * t) / c);
} else if (y <= -3.05e-307) {
tmp = t_2;
} else if (y <= 9.8e-253) {
tmp = t_1;
} else if (y <= 2.25e-63) {
tmp = t_2;
} else if (y <= 6.2e+83) {
tmp = t_1;
} else {
tmp = (x / z) * (9.0 * (y / c));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a / (c / t)) t_2 = (b / c) / z tmp = 0 if y <= -1.75e-133: tmp = (9.0 * y) / (c * (z / x)) elif y <= -2.8e-220: tmp = -4.0 * ((a * t) / c) elif y <= -3.05e-307: tmp = t_2 elif y <= 9.8e-253: tmp = t_1 elif y <= 2.25e-63: tmp = t_2 elif y <= 6.2e+83: tmp = t_1 else: tmp = (x / z) * (9.0 * (y / 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(-4.0 * Float64(a / Float64(c / t))) t_2 = Float64(Float64(b / c) / z) tmp = 0.0 if (y <= -1.75e-133) tmp = Float64(Float64(9.0 * y) / Float64(c * Float64(z / x))); elseif (y <= -2.8e-220) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (y <= -3.05e-307) tmp = t_2; elseif (y <= 9.8e-253) tmp = t_1; elseif (y <= 2.25e-63) tmp = t_2; elseif (y <= 6.2e+83) tmp = t_1; else tmp = Float64(Float64(x / z) * Float64(9.0 * Float64(y / 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 = -4.0 * (a / (c / t));
t_2 = (b / c) / z;
tmp = 0.0;
if (y <= -1.75e-133)
tmp = (9.0 * y) / (c * (z / x));
elseif (y <= -2.8e-220)
tmp = -4.0 * ((a * t) / c);
elseif (y <= -3.05e-307)
tmp = t_2;
elseif (y <= 9.8e-253)
tmp = t_1;
elseif (y <= 2.25e-63)
tmp = t_2;
elseif (y <= 6.2e+83)
tmp = t_1;
else
tmp = (x / z) * (9.0 * (y / 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[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.75e-133], N[(N[(9.0 * y), $MachinePrecision] / N[(c * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.8e-220], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.05e-307], t$95$2, If[LessEqual[y, 9.8e-253], t$95$1, If[LessEqual[y, 2.25e-63], t$95$2, If[LessEqual[y, 6.2e+83], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a}{\frac{c}{t}}\\
t_2 := \frac{\frac{b}{c}}{z}\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{-133}:\\
\;\;\;\;\frac{9 \cdot y}{c \cdot \frac{z}{x}}\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-220}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;y \leq -3.05 \cdot 10^{-307}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-253}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(9 \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if y < -1.75000000000000001e-133Initial program 80.2%
associate-/r*84.5%
associate-+l-84.5%
associate-*r*84.5%
associate-*r*83.4%
div-inv83.3%
associate--r-83.3%
fma-neg83.3%
associate-*r*84.4%
distribute-rgt-neg-in84.4%
associate-*l*84.4%
Applied egg-rr84.4%
Taylor expanded in x around inf 41.4%
*-commutative41.4%
*-commutative41.4%
times-frac42.5%
associate-*l*41.4%
Simplified41.4%
clear-num41.4%
associate-*l/41.4%
*-commutative41.4%
frac-times44.4%
*-un-lft-identity44.4%
Applied egg-rr44.4%
if -1.75000000000000001e-133 < y < -2.7999999999999999e-220Initial program 60.5%
Taylor expanded in z around inf 46.5%
if -2.7999999999999999e-220 < y < -3.04999999999999987e-307 or 9.7999999999999999e-253 < y < 2.25e-63Initial program 88.2%
Simplified95.7%
*-un-lft-identity95.7%
times-frac90.0%
+-commutative90.0%
fma-def90.0%
Applied egg-rr90.0%
Taylor expanded in b around inf 49.2%
associate-/r*53.7%
Simplified53.7%
if -3.04999999999999987e-307 < y < 9.7999999999999999e-253 or 2.25e-63 < y < 6.19999999999999984e83Initial program 76.8%
Taylor expanded in z around inf 50.6%
*-commutative50.6%
associate-/l*46.0%
Simplified46.0%
if 6.19999999999999984e83 < y Initial program 74.5%
associate-/r*74.8%
associate-+l-74.8%
associate-*r*74.9%
associate-*r*79.1%
div-inv79.0%
associate--r-79.0%
fma-neg79.0%
associate-*r*74.8%
distribute-rgt-neg-in74.8%
associate-*l*74.8%
Applied egg-rr74.8%
Taylor expanded in x around inf 58.5%
*-commutative58.5%
*-commutative58.5%
times-frac69.0%
associate-*l*69.0%
Simplified69.0%
Final simplification51.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a t))))
(if (<= y -2.1e+59)
(* 9.0 (* (/ x z) (/ y c)))
(if (or (<= y -7.5e-145) (not (<= y 5.1e+74)))
(/ (+ t_1 (* 9.0 (/ (* x y) z))) c)
(/ (+ (/ b z) t_1) 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 = -4.0 * (a * t);
double tmp;
if (y <= -2.1e+59) {
tmp = 9.0 * ((x / z) * (y / c));
} else if ((y <= -7.5e-145) || !(y <= 5.1e+74)) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = ((b / z) + t_1) / 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) :: tmp
t_1 = (-4.0d0) * (a * t)
if (y <= (-2.1d+59)) then
tmp = 9.0d0 * ((x / z) * (y / c))
else if ((y <= (-7.5d-145)) .or. (.not. (y <= 5.1d+74))) then
tmp = (t_1 + (9.0d0 * ((x * y) / z))) / c
else
tmp = ((b / z) + t_1) / 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 = -4.0 * (a * t);
double tmp;
if (y <= -2.1e+59) {
tmp = 9.0 * ((x / z) * (y / c));
} else if ((y <= -7.5e-145) || !(y <= 5.1e+74)) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = ((b / z) + t_1) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * t) tmp = 0 if y <= -2.1e+59: tmp = 9.0 * ((x / z) * (y / c)) elif (y <= -7.5e-145) or not (y <= 5.1e+74): tmp = (t_1 + (9.0 * ((x * y) / z))) / c else: tmp = ((b / z) + t_1) / 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(-4.0 * Float64(a * t)) tmp = 0.0 if (y <= -2.1e+59) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); elseif ((y <= -7.5e-145) || !(y <= 5.1e+74)) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(x * y) / z))) / c); else tmp = Float64(Float64(Float64(b / z) + t_1) / 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 = -4.0 * (a * t);
tmp = 0.0;
if (y <= -2.1e+59)
tmp = 9.0 * ((x / z) * (y / c));
elseif ((y <= -7.5e-145) || ~((y <= 5.1e+74)))
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
else
tmp = ((b / z) + t_1) / 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[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+59], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -7.5e-145], N[Not[LessEqual[y, 5.1e+74]], $MachinePrecision]], N[(N[(t$95$1 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] + t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+59}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-145} \lor \neg \left(y \leq 5.1 \cdot 10^{+74}\right):\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} + t_1}{c}\\
\end{array}
\end{array}
if y < -2.09999999999999984e59Initial program 83.1%
Taylor expanded in x around inf 53.4%
*-commutative53.4%
Simplified53.4%
Taylor expanded in x around 0 53.4%
*-commutative53.4%
times-frac59.6%
Simplified59.6%
if -2.09999999999999984e59 < y < -7.4999999999999996e-145 or 5.1000000000000004e74 < y Initial program 74.5%
associate-/r*79.5%
associate-+l-79.5%
associate-*r*79.5%
associate-*r*83.5%
div-inv83.4%
associate--r-83.4%
fma-neg83.4%
associate-*r*79.5%
distribute-rgt-neg-in79.5%
associate-*l*79.5%
Applied egg-rr79.5%
Taylor expanded in x around 0 88.2%
Taylor expanded in b around 0 73.9%
if -7.4999999999999996e-145 < y < 5.1000000000000004e74Initial program 79.2%
associate-/r*82.3%
associate-+l-82.3%
associate-*r*84.0%
associate-*r*90.3%
div-inv90.2%
associate--r-90.2%
fma-neg90.2%
associate-*r*83.9%
distribute-rgt-neg-in83.9%
associate-*l*83.9%
Applied egg-rr83.9%
Taylor expanded in x around 0 94.5%
Taylor expanded in x around 0 79.9%
Final simplification73.9%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= x -3.5e+270)
(* x (/ (* y (/ 9.0 c)) z))
(if (<= x -2.4e+111)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (<= x 1.12e-69)
(/ (+ (/ b z) (* -4.0 (* a t))) c)
(* 9.0 (* (/ x z) (/ y 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 (x <= -3.5e+270) {
tmp = x * ((y * (9.0 / c)) / z);
} else if (x <= -2.4e+111) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (x <= 1.12e-69) {
tmp = ((b / z) + (-4.0 * (a * t))) / c;
} else {
tmp = 9.0 * ((x / z) * (y / 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 (x <= (-3.5d+270)) then
tmp = x * ((y * (9.0d0 / c)) / z)
else if (x <= (-2.4d+111)) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else if (x <= 1.12d-69) then
tmp = ((b / z) + ((-4.0d0) * (a * t))) / c
else
tmp = 9.0d0 * ((x / z) * (y / 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 (x <= -3.5e+270) {
tmp = x * ((y * (9.0 / c)) / z);
} else if (x <= -2.4e+111) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (x <= 1.12e-69) {
tmp = ((b / z) + (-4.0 * (a * t))) / c;
} else {
tmp = 9.0 * ((x / z) * (y / 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 x <= -3.5e+270: tmp = x * ((y * (9.0 / c)) / z) elif x <= -2.4e+111: tmp = (b + (9.0 * (x * y))) / (z * c) elif x <= 1.12e-69: tmp = ((b / z) + (-4.0 * (a * t))) / c else: tmp = 9.0 * ((x / z) * (y / 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 (x <= -3.5e+270) tmp = Float64(x * Float64(Float64(y * Float64(9.0 / c)) / z)); elseif (x <= -2.4e+111) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif (x <= 1.12e-69) tmp = Float64(Float64(Float64(b / z) + Float64(-4.0 * Float64(a * t))) / c); else tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / 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 (x <= -3.5e+270)
tmp = x * ((y * (9.0 / c)) / z);
elseif (x <= -2.4e+111)
tmp = (b + (9.0 * (x * y))) / (z * c);
elseif (x <= 1.12e-69)
tmp = ((b / z) + (-4.0 * (a * t))) / c;
else
tmp = 9.0 * ((x / z) * (y / 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[x, -3.5e+270], N[(x * N[(N[(y * N[(9.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e+111], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.12e-69], N[(N[(N[(b / z), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+270}:\\
\;\;\;\;x \cdot \frac{y \cdot \frac{9}{c}}{z}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{+111}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if x < -3.4999999999999999e270Initial program 43.7%
Simplified59.8%
*-un-lft-identity59.8%
times-frac60.3%
+-commutative60.3%
fma-def60.3%
Applied egg-rr60.3%
Taylor expanded in x around inf 51.8%
associate-*r/51.8%
*-commutative51.8%
associate-*l*51.8%
times-frac76.0%
associate-/l*75.8%
associate-*r/75.9%
associate-*l/83.2%
associate-/r/83.4%
Simplified83.4%
if -3.4999999999999999e270 < x < -2.40000000000000006e111Initial program 80.1%
associate-+l-80.1%
associate-*l*80.1%
associate-*l*77.7%
Simplified77.7%
Taylor expanded in z around 0 71.4%
if -2.40000000000000006e111 < x < 1.12e-69Initial program 79.0%
associate-/r*85.5%
associate-+l-85.5%
associate-*r*85.6%
associate-*r*89.7%
div-inv89.6%
associate--r-89.6%
fma-neg89.6%
associate-*r*85.5%
distribute-rgt-neg-in85.5%
associate-*l*85.5%
Applied egg-rr85.5%
Taylor expanded in x around 0 96.6%
Taylor expanded in x around 0 84.7%
if 1.12e-69 < x Initial program 80.8%
Taylor expanded in x around inf 38.5%
*-commutative38.5%
Simplified38.5%
Taylor expanded in x around 0 38.5%
*-commutative38.5%
times-frac38.6%
Simplified38.6%
Final simplification68.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 (if (or (<= z -1.3e+172) (not (<= z 1.85e+117))) (* -4.0 (/ (* a t) c)) (/ (+ b (* 9.0 (* x y))) (* z c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.3e+172) || !(z <= 1.85e+117)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-1.3d+172)) .or. (.not. (z <= 1.85d+117))) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = (b + (9.0d0 * (x * y))) / (z * c)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.3e+172) || !(z <= 1.85e+117)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.3e+172) or not (z <= 1.85e+117): tmp = -4.0 * ((a * t) / c) else: tmp = (b + (9.0 * (x * y))) / (z * c) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.3e+172) || !(z <= 1.85e+117)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -1.3e+172) || ~((z <= 1.85e+117)))
tmp = -4.0 * ((a * t) / c);
else
tmp = (b + (9.0 * (x * y))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.3e+172], N[Not[LessEqual[z, 1.85e+117]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+172} \lor \neg \left(z \leq 1.85 \cdot 10^{+117}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.3e172 or 1.8499999999999999e117 < z Initial program 46.9%
Taylor expanded in z around inf 67.8%
if -1.3e172 < z < 1.8499999999999999e117Initial program 90.5%
associate-+l-90.5%
associate-*l*91.0%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in z around 0 71.0%
Final simplification70.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 (or (<= b -2.3e+66) (not (<= b 2.9e+141))) (/ (/ b c) z) (* -4.0 (/ (* a t) 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 <= -2.3e+66) || !(b <= 2.9e+141)) {
tmp = (b / c) / z;
} else {
tmp = -4.0 * ((a * t) / 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 <= (-2.3d+66)) .or. (.not. (b <= 2.9d+141))) then
tmp = (b / c) / z
else
tmp = (-4.0d0) * ((a * t) / 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 <= -2.3e+66) || !(b <= 2.9e+141)) {
tmp = (b / c) / z;
} else {
tmp = -4.0 * ((a * t) / 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 <= -2.3e+66) or not (b <= 2.9e+141): tmp = (b / c) / z else: tmp = -4.0 * ((a * t) / 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 <= -2.3e+66) || !(b <= 2.9e+141)) tmp = Float64(Float64(b / c) / z); else tmp = Float64(-4.0 * Float64(Float64(a * t) / 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 <= -2.3e+66) || ~((b <= 2.9e+141)))
tmp = (b / c) / z;
else
tmp = -4.0 * ((a * t) / c);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -2.3e+66], N[Not[LessEqual[b, 2.9e+141]], $MachinePrecision]], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / 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.3 \cdot 10^{+66} \lor \neg \left(b \leq 2.9 \cdot 10^{+141}\right):\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if b < -2.3e66 or 2.90000000000000007e141 < b Initial program 76.4%
Simplified79.7%
*-un-lft-identity79.7%
times-frac83.2%
+-commutative83.2%
fma-def83.2%
Applied egg-rr83.2%
Taylor expanded in b around inf 58.6%
associate-/r*67.7%
Simplified67.7%
if -2.3e66 < b < 2.90000000000000007e141Initial program 78.9%
Taylor expanded in z around inf 48.7%
Final simplification55.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* 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 78.1%
Taylor expanded in b around inf 34.1%
*-commutative34.1%
Simplified34.1%
Final simplification34.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ (/ b c) z))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (b / c) / z
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return (b / c) / z
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(Float64(b / c) / z) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = (b / c) / z;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{\frac{b}{c}}{z}
\end{array}
Initial program 78.1%
Simplified79.6%
*-un-lft-identity79.6%
times-frac81.0%
+-commutative81.0%
fma-def81.0%
Applied egg-rr81.0%
Taylor expanded in b around inf 34.1%
associate-/r*36.4%
Simplified36.4%
Final simplification36.4%
(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 2023308
(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)))