
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (/ t (/ c a)) -4.0 (/ (* x 9.0) (* z (/ c y))))))
(if (<= c -2.8e+144)
(+ (/ b (* c z)) t_1)
(if (<= c 1.02e+126)
(/ (fma t (* a -4.0) (/ (fma x (* 9.0 y) b) z)) c)
(+ t_1 (/ (/ b c) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((t / (c / a)), -4.0, ((x * 9.0) / (z * (c / y))));
double tmp;
if (c <= -2.8e+144) {
tmp = (b / (c * z)) + t_1;
} else if (c <= 1.02e+126) {
tmp = fma(t, (a * -4.0), (fma(x, (9.0 * y), b) / z)) / c;
} else {
tmp = t_1 + ((b / c) / z);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = fma(Float64(t / Float64(c / a)), -4.0, Float64(Float64(x * 9.0) / Float64(z * Float64(c / y)))) tmp = 0.0 if (c <= -2.8e+144) tmp = Float64(Float64(b / Float64(c * z)) + t_1); elseif (c <= 1.02e+126) tmp = Float64(fma(t, Float64(a * -4.0), Float64(fma(x, Float64(9.0 * y), b) / z)) / c); else tmp = Float64(t_1 + Float64(Float64(b / c) / z)); 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_] := Block[{t$95$1 = N[(N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(x * 9.0), $MachinePrecision] / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.8e+144], N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[c, 1.02e+126], N[(N[(t * N[(a * -4.0), $MachinePrecision] + N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(t$95$1 + N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{\frac{c}{a}}, -4, \frac{x \cdot 9}{z \cdot \frac{c}{y}}\right)\\
\mathbf{if}\;c \leq -2.8 \cdot 10^{+144}:\\
\;\;\;\;\frac{b}{c \cdot z} + t_1\\
\mathbf{elif}\;c \leq 1.02 \cdot 10^{+126}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if c < -2.80000000000000007e144Initial program 63.4%
associate-*l*63.4%
associate-*l*57.2%
Simplified57.2%
Taylor expanded in x around 0 70.6%
associate--l+70.6%
associate-/r*66.3%
cancel-sign-sub-inv66.3%
metadata-eval66.3%
+-commutative66.3%
*-commutative66.3%
fma-def66.3%
*-commutative66.3%
associate-/l*74.6%
associate-*r/74.6%
*-commutative74.6%
times-frac78.7%
*-commutative78.7%
associate-/l*84.8%
Simplified84.8%
frac-times82.7%
Applied egg-rr82.7%
Taylor expanded in b around 0 87.0%
if -2.80000000000000007e144 < c < 1.02e126Initial program 86.8%
associate-/r*90.1%
Simplified95.5%
if 1.02e126 < c Initial program 62.3%
associate-*l*62.1%
associate-*l*56.2%
Simplified56.2%
Taylor expanded in x around 0 65.1%
associate--l+65.1%
associate-/r*65.9%
cancel-sign-sub-inv65.9%
metadata-eval65.9%
+-commutative65.9%
*-commutative65.9%
fma-def65.9%
*-commutative65.9%
associate-/l*76.7%
associate-*r/76.7%
*-commutative76.7%
times-frac82.3%
*-commutative82.3%
associate-/l*90.9%
Simplified90.9%
frac-times93.7%
Applied egg-rr93.7%
Final simplification93.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 (<= c -7e+141) (not (<= c 8.8e+60))) (+ (/ b (* c z)) (fma (/ t (/ c a)) -4.0 (/ (* x 9.0) (* z (/ c y))))) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -7e+141) || !(c <= 8.8e+60)) {
tmp = (b / (c * z)) + fma((t / (c / a)), -4.0, ((x * 9.0) / (z * (c / y))));
} else {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -7e+141) || !(c <= 8.8e+60)) tmp = Float64(Float64(b / Float64(c * z)) + fma(Float64(t / Float64(c / a)), -4.0, Float64(Float64(x * 9.0) / Float64(z * Float64(c / y))))); else tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(a * -4.0))) / 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, -7e+141], N[Not[LessEqual[c, 8.8e+60]], $MachinePrecision]], N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(x * 9.0), $MachinePrecision] / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7 \cdot 10^{+141} \lor \neg \left(c \leq 8.8 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{b}{c \cdot z} + \mathsf{fma}\left(\frac{t}{\frac{c}{a}}, -4, \frac{x \cdot 9}{z \cdot \frac{c}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(a \cdot -4\right)}{c}\\
\end{array}
\end{array}
if c < -6.9999999999999999e141 or 8.79999999999999984e60 < c Initial program 64.0%
associate-*l*64.0%
associate-*l*57.3%
Simplified57.3%
Taylor expanded in x around 0 70.0%
associate--l+70.0%
associate-/r*68.0%
cancel-sign-sub-inv68.0%
metadata-eval68.0%
+-commutative68.0%
*-commutative68.0%
fma-def68.0%
*-commutative68.0%
associate-/l*76.6%
associate-*r/76.6%
*-commutative76.6%
times-frac80.9%
*-commutative80.9%
associate-/l*87.4%
Simplified87.4%
frac-times87.4%
Applied egg-rr87.4%
Taylor expanded in b around 0 89.2%
if -6.9999999999999999e141 < c < 8.79999999999999984e60Initial program 87.4%
associate-/r*90.2%
Simplified94.1%
Final simplification92.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
(let* ((t_1 (fma (/ t (/ c a)) -4.0 (/ (* x 9.0) (* z (/ c y))))))
(if (<= c -3.5e+139)
(+ (/ b (* c z)) t_1)
(if (<= c 8.4e+60)
(/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c)
(+ t_1 (/ (/ b c) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((t / (c / a)), -4.0, ((x * 9.0) / (z * (c / y))));
double tmp;
if (c <= -3.5e+139) {
tmp = (b / (c * z)) + t_1;
} else if (c <= 8.4e+60) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
} else {
tmp = t_1 + ((b / c) / z);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = fma(Float64(t / Float64(c / a)), -4.0, Float64(Float64(x * 9.0) / Float64(z * Float64(c / y)))) tmp = 0.0 if (c <= -3.5e+139) tmp = Float64(Float64(b / Float64(c * z)) + t_1); elseif (c <= 8.4e+60) tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(a * -4.0))) / c); else tmp = Float64(t_1 + Float64(Float64(b / c) / z)); 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_] := Block[{t$95$1 = N[(N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(x * 9.0), $MachinePrecision] / N[(z * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.5e+139], N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[c, 8.4e+60], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(t$95$1 + N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{\frac{c}{a}}, -4, \frac{x \cdot 9}{z \cdot \frac{c}{y}}\right)\\
\mathbf{if}\;c \leq -3.5 \cdot 10^{+139}:\\
\;\;\;\;\frac{b}{c \cdot z} + t_1\\
\mathbf{elif}\;c \leq 8.4 \cdot 10^{+60}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if c < -3.49999999999999978e139Initial program 63.4%
associate-*l*63.4%
associate-*l*57.2%
Simplified57.2%
Taylor expanded in x around 0 70.6%
associate--l+70.6%
associate-/r*66.3%
cancel-sign-sub-inv66.3%
metadata-eval66.3%
+-commutative66.3%
*-commutative66.3%
fma-def66.3%
*-commutative66.3%
associate-/l*74.6%
associate-*r/74.6%
*-commutative74.6%
times-frac78.7%
*-commutative78.7%
associate-/l*84.8%
Simplified84.8%
frac-times82.7%
Applied egg-rr82.7%
Taylor expanded in b around 0 87.0%
if -3.49999999999999978e139 < c < 8.4000000000000004e60Initial program 87.4%
associate-/r*90.2%
Simplified94.1%
if 8.4000000000000004e60 < c Initial program 64.7%
associate-*l*64.6%
associate-*l*57.5%
Simplified57.5%
Taylor expanded in x around 0 69.3%
associate--l+69.3%
associate-/r*69.9%
cancel-sign-sub-inv69.9%
metadata-eval69.9%
+-commutative69.9%
*-commutative69.9%
fma-def69.9%
*-commutative69.9%
associate-/l*78.7%
associate-*r/78.7%
*-commutative78.7%
times-frac83.2%
*-commutative83.2%
associate-/l*90.2%
Simplified90.2%
frac-times92.5%
Applied egg-rr92.5%
Final simplification92.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 -6e+25) (not (<= z 1.45e-30))) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c) (/ (+ b (- (* (* x 9.0) y) (* a (* t (* z 4.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 <= -6e+25) || !(z <= 1.45e-30)) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
} else {
tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -6e+25) || !(z <= 1.45e-30)) tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(a * -4.0))) / c); else tmp = Float64(Float64(b + Float64(Float64(Float64(x * 9.0) * y) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); 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[z, -6e+25], N[Not[LessEqual[z, 1.45e-30]], $MachinePrecision]], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+25} \lor \neg \left(z \leq 1.45 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(\left(x \cdot 9\right) \cdot y - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -6.00000000000000011e25 or 1.44999999999999995e-30 < z Initial program 67.3%
associate-/r*76.5%
Simplified90.3%
if -6.00000000000000011e25 < z < 1.44999999999999995e-30Initial program 92.4%
Final simplification91.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 (if (or (<= z -9.5e+121) (not (<= z 1.95e+178))) (/ (+ (* t (* a -4.0)) (* 9.0 (/ y (/ z x)))) c) (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* 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 <= -9.5e+121) || !(z <= 1.95e+178)) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (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 <= (-9.5d+121)) .or. (.not. (z <= 1.95d+178))) then
tmp = ((t * (a * (-4.0d0))) + (9.0d0 * (y / (z / x)))) / c
else
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (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 <= -9.5e+121) || !(z <= 1.95e+178)) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -9.5e+121) or not (z <= 1.95e+178): tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c else: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (c * z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -9.5e+121) || !(z <= 1.95e+178)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(9.0 * Float64(y / Float64(z / x)))) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(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 <= -9.5e+121) || ~((z <= 1.95e+178)))
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
else
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (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, -9.5e+121], N[Not[LessEqual[z, 1.95e+178]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+121} \lor \neg \left(z \leq 1.95 \cdot 10^{+178}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -9.49999999999999949e121 or 1.9499999999999999e178 < z Initial program 52.5%
associate-/r*64.3%
Simplified88.5%
Taylor expanded in x around inf 78.7%
associate-/l*85.7%
Simplified85.7%
if -9.49999999999999949e121 < z < 1.9499999999999999e178Initial program 89.2%
associate-*l*89.2%
associate-*l*85.6%
Simplified85.6%
Final simplification85.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 -6e+121) (not (<= z 4.2e+133))) (/ (+ (* t (* a -4.0)) (* 9.0 (/ y (/ z x)))) c) (/ (+ b (- (* (* x 9.0) y) (* a (* t (* z 4.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 <= -6e+121) || !(z <= 4.2e+133)) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.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 <= (-6d+121)) .or. (.not. (z <= 4.2d+133))) then
tmp = ((t * (a * (-4.0d0))) + (9.0d0 * (y / (z / x)))) / c
else
tmp = (b + (((x * 9.0d0) * y) - (a * (t * (z * 4.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 <= -6e+121) || !(z <= 4.2e+133)) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -6e+121) or not (z <= 4.2e+133): tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c else: tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (c * z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -6e+121) || !(z <= 4.2e+133)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(9.0 * Float64(y / Float64(z / x)))) / c); else tmp = Float64(Float64(b + Float64(Float64(Float64(x * 9.0) * y) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(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 <= -6e+121) || ~((z <= 4.2e+133)))
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
else
tmp = (b + (((x * 9.0) * y) - (a * (t * (z * 4.0))))) / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -6e+121], N[Not[LessEqual[z, 4.2e+133]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+121} \lor \neg \left(z \leq 4.2 \cdot 10^{+133}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(\left(x \cdot 9\right) \cdot y - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -6.0000000000000005e121 or 4.2e133 < z Initial program 57.1%
associate-/r*68.1%
Simplified89.3%
Taylor expanded in x around inf 78.8%
associate-/l*85.7%
Simplified85.7%
if -6.0000000000000005e121 < z < 4.2e133Initial program 90.0%
Final simplification88.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 (* 9.0 (* (/ y c) (/ x z)))))
(if (<= y -3.15e-38)
t_1
(if (<= y 2.1e-144)
(* -4.0 (/ a (/ c t)))
(if (<= y 3e-84)
(/ (/ b z) c)
(if (<= y 3.5e+92) (* -4.0 (* t (/ a c))) t_1))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * ((y / c) * (x / z));
double tmp;
if (y <= -3.15e-38) {
tmp = t_1;
} else if (y <= 2.1e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 3e-84) {
tmp = (b / z) / c;
} else if (y <= 3.5e+92) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = t_1;
}
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 = 9.0d0 * ((y / c) * (x / z))
if (y <= (-3.15d-38)) then
tmp = t_1
else if (y <= 2.1d-144) then
tmp = (-4.0d0) * (a / (c / t))
else if (y <= 3d-84) then
tmp = (b / z) / c
else if (y <= 3.5d+92) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = t_1
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 = 9.0 * ((y / c) * (x / z));
double tmp;
if (y <= -3.15e-38) {
tmp = t_1;
} else if (y <= 2.1e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 3e-84) {
tmp = (b / z) / c;
} else if (y <= 3.5e+92) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * ((y / c) * (x / z)) tmp = 0 if y <= -3.15e-38: tmp = t_1 elif y <= 2.1e-144: tmp = -4.0 * (a / (c / t)) elif y <= 3e-84: tmp = (b / z) / c elif y <= 3.5e+92: tmp = -4.0 * (t * (a / c)) else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))) tmp = 0.0 if (y <= -3.15e-38) tmp = t_1; elseif (y <= 2.1e-144) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (y <= 3e-84) tmp = Float64(Float64(b / z) / c); elseif (y <= 3.5e+92) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 9.0 * ((y / c) * (x / z));
tmp = 0.0;
if (y <= -3.15e-38)
tmp = t_1;
elseif (y <= 2.1e-144)
tmp = -4.0 * (a / (c / t));
elseif (y <= 3e-84)
tmp = (b / z) / c;
elseif (y <= 3.5e+92)
tmp = -4.0 * (t * (a / c));
else
tmp = t_1;
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[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.15e-38], t$95$1, If[LessEqual[y, 2.1e-144], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-84], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 3.5e+92], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{if}\;y \leq -3.15 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-144}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-84}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+92}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.1499999999999998e-38 or 3.49999999999999986e92 < y Initial program 74.8%
associate-*l*73.9%
associate-*l*70.4%
Simplified70.4%
Taylor expanded in x around inf 43.4%
expm1-log1p-u24.3%
expm1-udef22.5%
times-frac28.0%
Applied egg-rr28.0%
expm1-def34.7%
expm1-log1p56.8%
Simplified56.8%
if -3.1499999999999998e-38 < y < 2.1000000000000001e-144Initial program 87.0%
associate-*l*87.0%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in z around inf 52.1%
*-commutative52.1%
associate-/l*51.2%
Simplified51.2%
if 2.1000000000000001e-144 < y < 3.0000000000000001e-84Initial program 88.0%
associate-/r*80.7%
Simplified90.2%
Taylor expanded in x around 0 81.4%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in b around inf 61.5%
if 3.0000000000000001e-84 < y < 3.49999999999999986e92Initial program 73.3%
associate-/r*75.7%
Simplified88.8%
Taylor expanded in x around 0 77.7%
associate-*r*77.7%
*-commutative77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in b around 0 53.5%
associate-/l*51.4%
associate-/r/53.2%
Simplified53.2%
Final simplification54.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 (<= y -3.15e-38)
(* 9.0 (* (/ y c) (/ x z)))
(if (<= y 8.5e-144)
(* -4.0 (/ a (/ c t)))
(if (<= y 5e-86)
(/ (/ b z) c)
(if (<= y 2.9e+116)
(* -4.0 (* t (/ a c)))
(* 9.0 (/ y (/ (* c z) x))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -3.15e-38) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (y <= 8.5e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 5e-86) {
tmp = (b / z) / c;
} else if (y <= 2.9e+116) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = 9.0 * (y / ((c * z) / x));
}
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 (y <= (-3.15d-38)) then
tmp = 9.0d0 * ((y / c) * (x / z))
else if (y <= 8.5d-144) then
tmp = (-4.0d0) * (a / (c / t))
else if (y <= 5d-86) then
tmp = (b / z) / c
else if (y <= 2.9d+116) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = 9.0d0 * (y / ((c * z) / x))
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 (y <= -3.15e-38) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (y <= 8.5e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 5e-86) {
tmp = (b / z) / c;
} else if (y <= 2.9e+116) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = 9.0 * (y / ((c * z) / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if y <= -3.15e-38: tmp = 9.0 * ((y / c) * (x / z)) elif y <= 8.5e-144: tmp = -4.0 * (a / (c / t)) elif y <= 5e-86: tmp = (b / z) / c elif y <= 2.9e+116: tmp = -4.0 * (t * (a / c)) else: tmp = 9.0 * (y / ((c * z) / x)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -3.15e-38) tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); elseif (y <= 8.5e-144) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (y <= 5e-86) tmp = Float64(Float64(b / z) / c); elseif (y <= 2.9e+116) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(9.0 * Float64(y / Float64(Float64(c * z) / x))); 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 (y <= -3.15e-38)
tmp = 9.0 * ((y / c) * (x / z));
elseif (y <= 8.5e-144)
tmp = -4.0 * (a / (c / t));
elseif (y <= 5e-86)
tmp = (b / z) / c;
elseif (y <= 2.9e+116)
tmp = -4.0 * (t * (a / c));
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. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -3.15e-38], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e-144], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-86], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 2.9e+116], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(9.0 * N[(y / N[(N[(c * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{-38}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-144}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+116}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{c \cdot z}{x}}\\
\end{array}
\end{array}
if y < -3.1499999999999998e-38Initial program 79.0%
associate-*l*79.0%
associate-*l*76.0%
Simplified76.0%
Taylor expanded in x around inf 46.1%
expm1-log1p-u21.8%
expm1-udef20.1%
times-frac21.6%
Applied egg-rr21.6%
expm1-def26.3%
expm1-log1p54.9%
Simplified54.9%
if -3.1499999999999998e-38 < y < 8.49999999999999958e-144Initial program 87.2%
associate-*l*87.1%
associate-*l*85.1%
Simplified85.1%
Taylor expanded in z around inf 51.6%
*-commutative51.6%
associate-/l*50.7%
Simplified50.7%
if 8.49999999999999958e-144 < y < 4.9999999999999999e-86Initial program 86.6%
associate-/r*78.5%
Simplified89.1%
Taylor expanded in x around 0 79.3%
associate-*r*79.3%
*-commutative79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in b around inf 57.2%
if 4.9999999999999999e-86 < y < 2.9000000000000001e116Initial program 73.4%
associate-/r*73.7%
Simplified85.7%
Taylor expanded in x around 0 71.5%
associate-*r*71.5%
*-commutative71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in b around 0 49.3%
associate-/l*49.4%
associate-/r/51.0%
Simplified51.0%
if 2.9000000000000001e116 < y Initial program 68.4%
associate-*l*66.0%
associate-*l*63.6%
Simplified63.6%
Taylor expanded in x around inf 38.6%
expm1-log1p-u28.2%
expm1-udef26.0%
times-frac37.8%
Applied egg-rr37.8%
expm1-def46.2%
expm1-log1p58.0%
Simplified58.0%
frac-times38.6%
associate-/l*56.2%
Applied egg-rr56.2%
Final simplification52.9%
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 (<= y -3.15e-38)
(* 9.0 (* (/ y c) (/ x z)))
(if (<= y 2.1e-144)
(* -4.0 (/ a (/ c t)))
(if (<= y 3.05e-83)
(/ (/ b z) c)
(if (<= y 4.6e+117)
(* -4.0 (* t (/ a c)))
(* (/ x (/ c y)) (/ 9.0 z)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -3.15e-38) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (y <= 2.1e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 3.05e-83) {
tmp = (b / z) / c;
} else if (y <= 4.6e+117) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (x / (c / y)) * (9.0 / 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 (y <= (-3.15d-38)) then
tmp = 9.0d0 * ((y / c) * (x / z))
else if (y <= 2.1d-144) then
tmp = (-4.0d0) * (a / (c / t))
else if (y <= 3.05d-83) then
tmp = (b / z) / c
else if (y <= 4.6d+117) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (x / (c / y)) * (9.0d0 / 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 (y <= -3.15e-38) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (y <= 2.1e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 3.05e-83) {
tmp = (b / z) / c;
} else if (y <= 4.6e+117) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (x / (c / y)) * (9.0 / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if y <= -3.15e-38: tmp = 9.0 * ((y / c) * (x / z)) elif y <= 2.1e-144: tmp = -4.0 * (a / (c / t)) elif y <= 3.05e-83: tmp = (b / z) / c elif y <= 4.6e+117: tmp = -4.0 * (t * (a / c)) else: tmp = (x / (c / y)) * (9.0 / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -3.15e-38) tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); elseif (y <= 2.1e-144) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (y <= 3.05e-83) tmp = Float64(Float64(b / z) / c); elseif (y <= 4.6e+117) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(x / Float64(c / y)) * Float64(9.0 / 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 (y <= -3.15e-38)
tmp = 9.0 * ((y / c) * (x / z));
elseif (y <= 2.1e-144)
tmp = -4.0 * (a / (c / t));
elseif (y <= 3.05e-83)
tmp = (b / z) / c;
elseif (y <= 4.6e+117)
tmp = -4.0 * (t * (a / c));
else
tmp = (x / (c / y)) * (9.0 / 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[LessEqual[y, -3.15e-38], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-144], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.05e-83], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 4.6e+117], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(c / y), $MachinePrecision]), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{-38}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-144}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{-83}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+117}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{c}{y}} \cdot \frac{9}{z}\\
\end{array}
\end{array}
if y < -3.1499999999999998e-38Initial program 79.0%
associate-*l*79.0%
associate-*l*76.0%
Simplified76.0%
Taylor expanded in x around inf 46.1%
expm1-log1p-u21.8%
expm1-udef20.1%
times-frac21.6%
Applied egg-rr21.6%
expm1-def26.3%
expm1-log1p54.9%
Simplified54.9%
if -3.1499999999999998e-38 < y < 2.1000000000000001e-144Initial program 87.0%
associate-*l*87.0%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in z around inf 52.1%
*-commutative52.1%
associate-/l*51.2%
Simplified51.2%
if 2.1000000000000001e-144 < y < 3.05000000000000001e-83Initial program 88.0%
associate-/r*80.7%
Simplified90.2%
Taylor expanded in x around 0 81.4%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in b around inf 61.5%
if 3.05000000000000001e-83 < y < 4.59999999999999976e117Initial program 73.4%
associate-/r*73.7%
Simplified85.7%
Taylor expanded in x around 0 71.5%
associate-*r*71.5%
*-commutative71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in b around 0 49.3%
associate-/l*49.4%
associate-/r/51.0%
Simplified51.0%
if 4.59999999999999976e117 < y Initial program 68.4%
associate-*l*66.0%
associate-*l*63.6%
Simplified63.6%
Taylor expanded in x around inf 38.6%
associate-*r/38.5%
*-commutative38.5%
times-frac44.9%
*-commutative44.9%
associate-/l*60.3%
Simplified60.3%
Final simplification54.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 (<= y -3.15e-38)
(* 9.0 (* (/ y c) (/ x z)))
(if (<= y 1.2e-144)
(* -4.0 (/ a (/ c t)))
(if (<= y 3.05e-83)
(/ (/ b z) c)
(if (<= y 2.4e+116)
(* -4.0 (* t (/ a c)))
(/ (* x (/ (* 9.0 y) c)) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -3.15e-38) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (y <= 1.2e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 3.05e-83) {
tmp = (b / z) / c;
} else if (y <= 2.4e+116) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (x * ((9.0 * y) / 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 (y <= (-3.15d-38)) then
tmp = 9.0d0 * ((y / c) * (x / z))
else if (y <= 1.2d-144) then
tmp = (-4.0d0) * (a / (c / t))
else if (y <= 3.05d-83) then
tmp = (b / z) / c
else if (y <= 2.4d+116) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (x * ((9.0d0 * y) / 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 (y <= -3.15e-38) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (y <= 1.2e-144) {
tmp = -4.0 * (a / (c / t));
} else if (y <= 3.05e-83) {
tmp = (b / z) / c;
} else if (y <= 2.4e+116) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (x * ((9.0 * y) / c)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if y <= -3.15e-38: tmp = 9.0 * ((y / c) * (x / z)) elif y <= 1.2e-144: tmp = -4.0 * (a / (c / t)) elif y <= 3.05e-83: tmp = (b / z) / c elif y <= 2.4e+116: tmp = -4.0 * (t * (a / c)) else: tmp = (x * ((9.0 * y) / c)) / z return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -3.15e-38) tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); elseif (y <= 1.2e-144) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (y <= 3.05e-83) tmp = Float64(Float64(b / z) / c); elseif (y <= 2.4e+116) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(x * Float64(Float64(9.0 * y) / 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 (y <= -3.15e-38)
tmp = 9.0 * ((y / c) * (x / z));
elseif (y <= 1.2e-144)
tmp = -4.0 * (a / (c / t));
elseif (y <= 3.05e-83)
tmp = (b / z) / c;
elseif (y <= 2.4e+116)
tmp = -4.0 * (t * (a / c));
else
tmp = (x * ((9.0 * y) / 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[LessEqual[y, -3.15e-38], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-144], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.05e-83], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 2.4e+116], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(9.0 * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{-38}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-144}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{-83}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+116}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{9 \cdot y}{c}}{z}\\
\end{array}
\end{array}
if y < -3.1499999999999998e-38Initial program 79.0%
associate-*l*79.0%
associate-*l*76.0%
Simplified76.0%
Taylor expanded in x around inf 46.1%
expm1-log1p-u21.8%
expm1-udef20.1%
times-frac21.6%
Applied egg-rr21.6%
expm1-def26.3%
expm1-log1p54.9%
Simplified54.9%
if -3.1499999999999998e-38 < y < 1.19999999999999997e-144Initial program 87.0%
associate-*l*87.0%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in z around inf 52.1%
*-commutative52.1%
associate-/l*51.2%
Simplified51.2%
if 1.19999999999999997e-144 < y < 3.05000000000000001e-83Initial program 88.0%
associate-/r*80.7%
Simplified90.2%
Taylor expanded in x around 0 81.4%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in b around inf 61.5%
if 3.05000000000000001e-83 < y < 2.4e116Initial program 73.4%
associate-/r*73.7%
Simplified85.7%
Taylor expanded in x around 0 71.5%
associate-*r*71.5%
*-commutative71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in b around 0 49.3%
associate-/l*49.4%
associate-/r/51.0%
Simplified51.0%
if 2.4e116 < y Initial program 68.4%
associate-*l*66.0%
associate-*l*63.6%
Simplified63.6%
Taylor expanded in x around inf 38.6%
expm1-log1p-u28.2%
expm1-udef26.0%
times-frac37.8%
Applied egg-rr37.8%
expm1-def46.2%
expm1-log1p58.0%
Simplified58.0%
associate-*r*58.0%
associate-*r/60.2%
associate-*r/60.3%
Applied egg-rr60.3%
Final simplification54.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 (or (<= z -3.25e-6) (not (<= z 2.85e-27))) (/ (+ (* t (* a -4.0)) (/ b z)) c) (/ (+ b (* 9.0 (* x y))) (* 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 <= -3.25e-6) || !(z <= 2.85e-27)) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (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 <= (-3.25d-6)) .or. (.not. (z <= 2.85d-27))) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / c
else
tmp = (b + (9.0d0 * (x * y))) / (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 <= -3.25e-6) || !(z <= 2.85e-27)) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -3.25e-6) or not (z <= 2.85e-27): tmp = ((t * (a * -4.0)) + (b / z)) / c else: tmp = (b + (9.0 * (x * y))) / (c * z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.25e-6) || !(z <= 2.85e-27)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(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 <= -3.25e-6) || ~((z <= 2.85e-27)))
tmp = ((t * (a * -4.0)) + (b / z)) / c;
else
tmp = (b + (9.0 * (x * y))) / (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, -3.25e-6], N[Not[LessEqual[z, 2.85e-27]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{-6} \lor \neg \left(z \leq 2.85 \cdot 10^{-27}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -3.2499999999999998e-6 or 2.8499999999999998e-27 < z Initial program 69.2%
associate-/r*77.8%
Simplified90.9%
Taylor expanded in x around 0 78.7%
associate-*r*78.7%
*-commutative78.7%
*-commutative78.7%
Simplified78.7%
if -3.2499999999999998e-6 < z < 2.8499999999999998e-27Initial program 91.8%
associate-*l*91.8%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in z around 0 77.5%
Final simplification78.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
(let* ((t_1 (* t (* a -4.0))))
(if (<= z -6e+105)
(* t_1 (/ 1.0 c))
(if (<= z 1.55e+23) (/ (+ b (* 9.0 (* x y))) (* c z)) (/ t_1 c)))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -6e+105) {
tmp = t_1 * (1.0 / c);
} else if (z <= 1.55e+23) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = t_1 / 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 = t * (a * (-4.0d0))
if (z <= (-6d+105)) then
tmp = t_1 * (1.0d0 / c)
else if (z <= 1.55d+23) then
tmp = (b + (9.0d0 * (x * y))) / (c * z)
else
tmp = t_1 / 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 = t * (a * -4.0);
double tmp;
if (z <= -6e+105) {
tmp = t_1 * (1.0 / c);
} else if (z <= 1.55e+23) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = t_1 / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) tmp = 0 if z <= -6e+105: tmp = t_1 * (1.0 / c) elif z <= 1.55e+23: tmp = (b + (9.0 * (x * y))) / (c * z) else: tmp = t_1 / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -6e+105) tmp = Float64(t_1 * Float64(1.0 / c)); elseif (z <= 1.55e+23) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); else tmp = Float64(t_1 / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (a * -4.0);
tmp = 0.0;
if (z <= -6e+105)
tmp = t_1 * (1.0 / c);
elseif (z <= 1.55e+23)
tmp = (b + (9.0 * (x * y))) / (c * z);
else
tmp = t_1 / 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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+105], N[(t$95$1 * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+23], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+105}:\\
\;\;\;\;t_1 \cdot \frac{1}{c}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+23}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{c}\\
\end{array}
\end{array}
if z < -6.0000000000000001e105Initial program 57.3%
associate-/r*67.7%
Simplified93.8%
Taylor expanded in z around inf 67.7%
associate-*r*67.7%
*-commutative67.7%
*-commutative67.7%
Simplified67.7%
div-inv67.7%
Applied egg-rr67.7%
if -6.0000000000000001e105 < z < 1.54999999999999985e23Initial program 91.7%
associate-*l*91.6%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in z around 0 73.3%
if 1.54999999999999985e23 < z Initial program 66.7%
associate-/r*77.0%
Simplified86.8%
Taylor expanded in z around inf 62.5%
associate-*r*62.5%
*-commutative62.5%
*-commutative62.5%
Simplified62.5%
Final simplification69.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 (if (<= b -1.2e+137) (/ b (* c z)) (if (<= b 2.1e+82) (* -4.0 (* t (/ a c))) (/ (/ 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 (b <= -1.2e+137) {
tmp = b / (c * z);
} else if (b <= 2.1e+82) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / z) / c;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.2d+137)) then
tmp = b / (c * z)
else if (b <= 2.1d+82) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (b / 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 (b <= -1.2e+137) {
tmp = b / (c * z);
} else if (b <= 2.1e+82) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / z) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1.2e+137: tmp = b / (c * z) elif b <= 2.1e+82: tmp = -4.0 * (t * (a / c)) else: tmp = (b / z) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1.2e+137) tmp = Float64(b / Float64(c * z)); elseif (b <= 2.1e+82) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(b / 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 (b <= -1.2e+137)
tmp = b / (c * z);
elseif (b <= 2.1e+82)
tmp = -4.0 * (t * (a / c));
else
tmp = (b / z) / c;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1.2e+137], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+82], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{+137}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+82}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -1.19999999999999992e137Initial program 81.1%
associate-*l*81.2%
associate-*l*81.0%
Simplified81.0%
Taylor expanded in b around inf 58.5%
if -1.19999999999999992e137 < b < 2.1e82Initial program 78.0%
associate-/r*77.1%
Simplified82.9%
Taylor expanded in x around 0 57.7%
associate-*r*57.7%
*-commutative57.7%
*-commutative57.7%
Simplified57.7%
Taylor expanded in b around 0 46.0%
associate-/l*47.3%
associate-/r/50.0%
Simplified50.0%
if 2.1e82 < b Initial program 84.5%
associate-/r*87.1%
Simplified89.7%
Taylor expanded in x around 0 84.5%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in b around inf 64.8%
Final simplification53.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 (<= b -1.2e+137) (/ b (* c z)) (if (<= b 3.5e+80) (* -4.0 (* t (/ a c))) (/ (/ 1.0 z) (/ c b)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.2e+137) {
tmp = b / (c * z);
} else if (b <= 3.5e+80) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (1.0 / z) / (c / b);
}
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 (b <= (-1.2d+137)) then
tmp = b / (c * z)
else if (b <= 3.5d+80) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (1.0d0 / z) / (c / b)
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 (b <= -1.2e+137) {
tmp = b / (c * z);
} else if (b <= 3.5e+80) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (1.0 / z) / (c / b);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1.2e+137: tmp = b / (c * z) elif b <= 3.5e+80: tmp = -4.0 * (t * (a / c)) else: tmp = (1.0 / z) / (c / b) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1.2e+137) tmp = Float64(b / Float64(c * z)); elseif (b <= 3.5e+80) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(1.0 / z) / Float64(c / b)); 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 (b <= -1.2e+137)
tmp = b / (c * z);
elseif (b <= 3.5e+80)
tmp = -4.0 * (t * (a / c));
else
tmp = (1.0 / z) / (c / b);
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[b, -1.2e+137], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.5e+80], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] / N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{+137}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+80}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{c}{b}}\\
\end{array}
\end{array}
if b < -1.19999999999999992e137Initial program 81.1%
associate-*l*81.2%
associate-*l*81.0%
Simplified81.0%
Taylor expanded in b around inf 58.5%
if -1.19999999999999992e137 < b < 3.49999999999999994e80Initial program 78.0%
associate-/r*77.1%
Simplified82.9%
Taylor expanded in x around 0 57.7%
associate-*r*57.7%
*-commutative57.7%
*-commutative57.7%
Simplified57.7%
Taylor expanded in b around 0 46.0%
associate-/l*47.3%
associate-/r/50.0%
Simplified50.0%
if 3.49999999999999994e80 < b Initial program 84.5%
associate-*l*84.5%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in b around inf 63.3%
associate-/r*63.4%
Simplified63.4%
associate-/r*63.3%
div-inv63.2%
Applied egg-rr63.2%
associate-*r/63.3%
frac-times63.5%
*-commutative63.5%
clear-num63.4%
un-div-inv65.9%
Applied egg-rr65.9%
Final simplification53.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 (/ b (* c z)))
assert(x < y);
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.
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;
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]) def code(x, y, z, t, a, b, c): return b / (c * z)
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
x, y = num2cell(sort([x, y])){:}
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. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 79.5%
associate-*l*79.0%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in b around inf 31.0%
Final simplification31.0%
(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 2023214
(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)))