
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ y (+ x t)))) (- (fma z (/ (+ y x) t_1) (* a (/ (+ y t) t_1))) (* y (/ b t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
return fma(z, ((y + x) / t_1), (a * ((y + t) / t_1))) - (y * (b / t_1));
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) return Float64(fma(z, Float64(Float64(y + x) / t_1), Float64(a * Float64(Float64(y + t) / t_1))) - Float64(y * Float64(b / t_1))) end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, N[(N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathsf{fma}\left(z, \frac{y + x}{t\_1}, a \cdot \frac{y + t}{t\_1}\right) - y \cdot \frac{b}{t\_1}
\end{array}
\end{array}
Initial program 58.5%
Taylor expanded in b around 0 58.5%
mul-1-neg58.5%
+-commutative58.5%
unsub-neg58.5%
+-commutative58.5%
associate-/l*70.1%
fma-define70.1%
+-commutative70.1%
associate-+r+70.1%
associate-/l*86.3%
associate-+r+86.3%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 -2e+303) (not (<= t_2 1e+252)))
(- (fma z (/ 1.0 (/ t_1 (+ y x))) a) (* y (/ b t_1)))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -2e+303) || !(t_2 <= 1e+252)) {
tmp = fma(z, (1.0 / (t_1 / (y + x))), a) - (y * (b / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= -2e+303) || !(t_2 <= 1e+252)) tmp = Float64(fma(z, Float64(1.0 / Float64(t_1 / Float64(y + x))), a) - Float64(y * Float64(b / t_1))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+303], N[Not[LessEqual[t$95$2, 1e+252]], $MachinePrecision]], N[(N[(z * N[(1.0 / N[(t$95$1 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+303} \lor \neg \left(t\_2 \leq 10^{+252}\right):\\
\;\;\;\;\mathsf{fma}\left(z, \frac{1}{\frac{t\_1}{y + x}}, a\right) - y \cdot \frac{b}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e303 or 1.0000000000000001e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in b around 0 6.3%
mul-1-neg6.3%
+-commutative6.3%
unsub-neg6.3%
+-commutative6.3%
associate-/l*32.6%
fma-define32.6%
+-commutative32.6%
associate-+r+32.6%
associate-/l*69.2%
associate-+r+69.2%
Simplified99.9%
clear-num99.9%
inv-pow99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
unpow-199.9%
Simplified99.9%
Taylor expanded in t around inf 88.8%
if -2e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e252Initial program 99.7%
Final simplification94.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) t_1))
(t_3 (* y (/ b t_1))))
(if (<= t_2 -2e+303)
(- (+ z a) t_3)
(if (<= t_2 1e+252)
t_2
(-
(* a (+ (/ t t_1) (+ (/ y t_1) (* z (/ (+ y x) (* a t_1))))))
t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = y * (b / t_1);
double tmp;
if (t_2 <= -2e+303) {
tmp = (z + a) - t_3;
} else if (t_2 <= 1e+252) {
tmp = t_2;
} else {
tmp = (a * ((t / t_1) + ((y / t_1) + (z * ((y + x) / (a * t_1)))))) - t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1
t_3 = y * (b / t_1)
if (t_2 <= (-2d+303)) then
tmp = (z + a) - t_3
else if (t_2 <= 1d+252) then
tmp = t_2
else
tmp = (a * ((t / t_1) + ((y / t_1) + (z * ((y + x) / (a * t_1)))))) - t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = y * (b / t_1);
double tmp;
if (t_2 <= -2e+303) {
tmp = (z + a) - t_3;
} else if (t_2 <= 1e+252) {
tmp = t_2;
} else {
tmp = (a * ((t / t_1) + ((y / t_1) + (z * ((y + x) / (a * t_1)))))) - t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1 t_3 = y * (b / t_1) tmp = 0 if t_2 <= -2e+303: tmp = (z + a) - t_3 elif t_2 <= 1e+252: tmp = t_2 else: tmp = (a * ((t / t_1) + ((y / t_1) + (z * ((y + x) / (a * t_1)))))) - t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(y * Float64(b / t_1)) tmp = 0.0 if (t_2 <= -2e+303) tmp = Float64(Float64(z + a) - t_3); elseif (t_2 <= 1e+252) tmp = t_2; else tmp = Float64(Float64(a * Float64(Float64(t / t_1) + Float64(Float64(y / t_1) + Float64(z * Float64(Float64(y + x) / Float64(a * t_1)))))) - t_3); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1; t_3 = y * (b / t_1); tmp = 0.0; if (t_2 <= -2e+303) tmp = (z + a) - t_3; elseif (t_2 <= 1e+252) tmp = t_2; else tmp = (a * ((t / t_1) + ((y / t_1) + (z * ((y + x) / (a * t_1)))))) - t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+303], N[(N[(z + a), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[t$95$2, 1e+252], t$95$2, N[(N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(y / t$95$1), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
t_3 := y \cdot \frac{b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+303}:\\
\;\;\;\;\left(z + a\right) - t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+252}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_1} + \left(\frac{y}{t\_1} + z \cdot \frac{y + x}{a \cdot t\_1}\right)\right) - t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e303Initial program 8.6%
Taylor expanded in b around 0 8.6%
mul-1-neg8.6%
+-commutative8.6%
unsub-neg8.6%
+-commutative8.6%
associate-/l*40.5%
fma-define40.5%
+-commutative40.5%
associate-+r+40.5%
associate-/l*72.2%
associate-+r+72.2%
Simplified99.8%
Taylor expanded in y around inf 79.3%
if -2e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e252Initial program 99.7%
if 1.0000000000000001e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.6%
Taylor expanded in b around 0 4.6%
mul-1-neg4.6%
+-commutative4.6%
unsub-neg4.6%
+-commutative4.6%
associate-/l*27.0%
fma-define27.0%
+-commutative27.0%
associate-+r+27.0%
associate-/l*67.0%
associate-+r+67.0%
Simplified99.9%
Taylor expanded in a around inf 48.7%
associate-+r+48.7%
+-commutative48.7%
associate-+r+48.7%
+-commutative48.7%
associate-/l*81.2%
+-commutative81.2%
associate-+r+81.2%
+-commutative81.2%
Simplified81.2%
Final simplification91.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 -2e+303) (not (<= t_2 1e+252)))
(- (+ z a) (* y (/ b t_1)))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -2e+303) || !(t_2 <= 1e+252)) {
tmp = (z + a) - (y * (b / t_1));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1
if ((t_2 <= (-2d+303)) .or. (.not. (t_2 <= 1d+252))) then
tmp = (z + a) - (y * (b / t_1))
else
tmp = 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 t_1 = y + (x + t);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -2e+303) || !(t_2 <= 1e+252)) {
tmp = (z + a) - (y * (b / t_1));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -2e+303) or not (t_2 <= 1e+252): tmp = (z + a) - (y * (b / t_1)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= -2e+303) || !(t_2 <= 1e+252)) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / t_1))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -2e+303) || ~((t_2 <= 1e+252))) tmp = (z + a) - (y * (b / t_1)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+303], N[Not[LessEqual[t$95$2, 1e+252]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+303} \lor \neg \left(t\_2 \leq 10^{+252}\right):\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e303 or 1.0000000000000001e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in b around 0 6.3%
mul-1-neg6.3%
+-commutative6.3%
unsub-neg6.3%
+-commutative6.3%
associate-/l*32.6%
fma-define32.6%
+-commutative32.6%
associate-+r+32.6%
associate-/l*69.2%
associate-+r+69.2%
Simplified99.9%
Taylor expanded in y around inf 75.4%
if -2e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e252Initial program 99.7%
Final simplification89.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z (* t (- (/ a x) (/ z x)))) (/ (* y b) x)))
(t_2 (- (+ z a) (* y (/ b (+ y (+ x t)))))))
(if (<= x -4.4e+184)
t_1
(if (<= x 5e-306)
t_2
(if (<= x 5.5e-190)
(- (+ a (/ (* z y) (+ y t))) (/ (* y b) (+ y t)))
(if (<= x 1e+191) t_2 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + (t * ((a / x) - (z / x)))) - ((y * b) / x);
double t_2 = (z + a) - (y * (b / (y + (x + t))));
double tmp;
if (x <= -4.4e+184) {
tmp = t_1;
} else if (x <= 5e-306) {
tmp = t_2;
} else if (x <= 5.5e-190) {
tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t));
} else if (x <= 1e+191) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + (t * ((a / x) - (z / x)))) - ((y * b) / x)
t_2 = (z + a) - (y * (b / (y + (x + t))))
if (x <= (-4.4d+184)) then
tmp = t_1
else if (x <= 5d-306) then
tmp = t_2
else if (x <= 5.5d-190) then
tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t))
else if (x <= 1d+191) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + (t * ((a / x) - (z / x)))) - ((y * b) / x);
double t_2 = (z + a) - (y * (b / (y + (x + t))));
double tmp;
if (x <= -4.4e+184) {
tmp = t_1;
} else if (x <= 5e-306) {
tmp = t_2;
} else if (x <= 5.5e-190) {
tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t));
} else if (x <= 1e+191) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + (t * ((a / x) - (z / x)))) - ((y * b) / x) t_2 = (z + a) - (y * (b / (y + (x + t)))) tmp = 0 if x <= -4.4e+184: tmp = t_1 elif x <= 5e-306: tmp = t_2 elif x <= 5.5e-190: tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t)) elif x <= 1e+191: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(t * Float64(Float64(a / x) - Float64(z / x)))) - Float64(Float64(y * b) / x)) t_2 = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(y + Float64(x + t))))) tmp = 0.0 if (x <= -4.4e+184) tmp = t_1; elseif (x <= 5e-306) tmp = t_2; elseif (x <= 5.5e-190) tmp = Float64(Float64(a + Float64(Float64(z * y) / Float64(y + t))) - Float64(Float64(y * b) / Float64(y + t))); elseif (x <= 1e+191) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + (t * ((a / x) - (z / x)))) - ((y * b) / x); t_2 = (z + a) - (y * (b / (y + (x + t)))); tmp = 0.0; if (x <= -4.4e+184) tmp = t_1; elseif (x <= 5e-306) tmp = t_2; elseif (x <= 5.5e-190) tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t)); elseif (x <= 1e+191) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(t * N[(N[(a / x), $MachinePrecision] - N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+184], t$95$1, If[LessEqual[x, 5e-306], t$95$2, If[LessEqual[x, 5.5e-190], N[(N[(a + N[(N[(z * y), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e+191], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\right) - \frac{y \cdot b}{x}\\
t_2 := \left(z + a\right) - y \cdot \frac{b}{y + \left(x + t\right)}\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-306}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-190}:\\
\;\;\;\;\left(a + \frac{z \cdot y}{y + t}\right) - \frac{y \cdot b}{y + t}\\
\mathbf{elif}\;x \leq 10^{+191}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.4e184 or 1.00000000000000007e191 < x Initial program 47.5%
Taylor expanded in x around inf 55.7%
Taylor expanded in t around 0 77.0%
Taylor expanded in t around inf 68.6%
if -4.4e184 < x < 4.99999999999999998e-306 or 5.50000000000000048e-190 < x < 1.00000000000000007e191Initial program 56.3%
Taylor expanded in b around 0 56.3%
mul-1-neg56.3%
+-commutative56.3%
unsub-neg56.3%
+-commutative56.3%
associate-/l*68.3%
fma-define68.3%
+-commutative68.3%
associate-+r+68.3%
associate-/l*84.1%
associate-+r+84.1%
Simplified99.3%
Taylor expanded in y around inf 75.2%
if 4.99999999999999998e-306 < x < 5.50000000000000048e-190Initial program 87.0%
Taylor expanded in b around 0 86.9%
mul-1-neg86.9%
+-commutative86.9%
unsub-neg86.9%
+-commutative86.9%
associate-/l*87.0%
fma-define87.1%
+-commutative87.1%
associate-+r+87.1%
associate-/l*96.6%
associate-+r+96.6%
Simplified87.6%
Taylor expanded in x around 0 92.8%
Final simplification76.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) (* y (/ b t_1)))))
(if (<= x -2.75e+144)
(* z (/ x t_1))
(if (<= x 5.5e-306)
t_2
(if (<= x 4.3e-187)
(- (+ a (/ (* z y) (+ y t))) (/ (* y b) (+ y t)))
(if (<= x 2.9e+189) t_2 (+ z (* t (- (/ a x) (/ z x))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - (y * (b / t_1));
double tmp;
if (x <= -2.75e+144) {
tmp = z * (x / t_1);
} else if (x <= 5.5e-306) {
tmp = t_2;
} else if (x <= 4.3e-187) {
tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t));
} else if (x <= 2.9e+189) {
tmp = t_2;
} else {
tmp = z + (t * ((a / x) - (z / x)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (z + a) - (y * (b / t_1))
if (x <= (-2.75d+144)) then
tmp = z * (x / t_1)
else if (x <= 5.5d-306) then
tmp = t_2
else if (x <= 4.3d-187) then
tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t))
else if (x <= 2.9d+189) then
tmp = t_2
else
tmp = z + (t * ((a / x) - (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - (y * (b / t_1));
double tmp;
if (x <= -2.75e+144) {
tmp = z * (x / t_1);
} else if (x <= 5.5e-306) {
tmp = t_2;
} else if (x <= 4.3e-187) {
tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t));
} else if (x <= 2.9e+189) {
tmp = t_2;
} else {
tmp = z + (t * ((a / x) - (z / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - (y * (b / t_1)) tmp = 0 if x <= -2.75e+144: tmp = z * (x / t_1) elif x <= 5.5e-306: tmp = t_2 elif x <= 4.3e-187: tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t)) elif x <= 2.9e+189: tmp = t_2 else: tmp = z + (t * ((a / x) - (z / x))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(z + a) - Float64(y * Float64(b / t_1))) tmp = 0.0 if (x <= -2.75e+144) tmp = Float64(z * Float64(x / t_1)); elseif (x <= 5.5e-306) tmp = t_2; elseif (x <= 4.3e-187) tmp = Float64(Float64(a + Float64(Float64(z * y) / Float64(y + t))) - Float64(Float64(y * b) / Float64(y + t))); elseif (x <= 2.9e+189) tmp = t_2; else tmp = Float64(z + Float64(t * Float64(Float64(a / x) - Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (z + a) - (y * (b / t_1)); tmp = 0.0; if (x <= -2.75e+144) tmp = z * (x / t_1); elseif (x <= 5.5e-306) tmp = t_2; elseif (x <= 4.3e-187) tmp = (a + ((z * y) / (y + t))) - ((y * b) / (y + t)); elseif (x <= 2.9e+189) tmp = t_2; else tmp = z + (t * ((a / x) - (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.75e+144], N[(z * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-306], t$95$2, If[LessEqual[x, 4.3e-187], N[(N[(a + N[(N[(z * y), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+189], t$95$2, N[(z + N[(t * N[(N[(a / x), $MachinePrecision] - N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - y \cdot \frac{b}{t\_1}\\
\mathbf{if}\;x \leq -2.75 \cdot 10^{+144}:\\
\;\;\;\;z \cdot \frac{x}{t\_1}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-306}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-187}:\\
\;\;\;\;\left(a + \frac{z \cdot y}{y + t}\right) - \frac{y \cdot b}{y + t}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+189}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < -2.75000000000000011e144Initial program 48.9%
Taylor expanded in x around inf 29.6%
*-commutative29.6%
Simplified29.6%
associate-/l*60.8%
+-commutative60.8%
+-commutative60.8%
Applied egg-rr60.8%
if -2.75000000000000011e144 < x < 5.49999999999999992e-306 or 4.3e-187 < x < 2.90000000000000019e189Initial program 55.7%
Taylor expanded in b around 0 55.7%
mul-1-neg55.7%
+-commutative55.7%
unsub-neg55.7%
+-commutative55.7%
associate-/l*67.8%
fma-define67.8%
+-commutative67.8%
associate-+r+67.8%
associate-/l*83.3%
associate-+r+83.3%
Simplified99.3%
Taylor expanded in y around inf 76.1%
if 5.49999999999999992e-306 < x < 4.3e-187Initial program 87.0%
Taylor expanded in b around 0 86.9%
mul-1-neg86.9%
+-commutative86.9%
unsub-neg86.9%
+-commutative86.9%
associate-/l*87.0%
fma-define87.1%
+-commutative87.1%
associate-+r+87.1%
associate-/l*96.6%
associate-+r+96.6%
Simplified87.6%
Taylor expanded in x around 0 92.8%
if 2.90000000000000019e189 < x Initial program 54.6%
Taylor expanded in y around 0 44.9%
Taylor expanded in t around 0 71.8%
Final simplification75.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)) (t_2 (* z (/ (+ y x) t_1))) (t_3 (- (+ z a) b)))
(if (<= y -8.5e+24)
t_3
(if (<= y -3.4e-272)
t_2
(if (<= y 3e-284)
(- a (/ (* y b) t_1))
(if (<= y 3.8e-147) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = z * ((y + x) / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -8.5e+24) {
tmp = t_3;
} else if (y <= -3.4e-272) {
tmp = t_2;
} else if (y <= 3e-284) {
tmp = a - ((y * b) / t_1);
} else if (y <= 3.8e-147) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (y + x) + t
t_2 = z * ((y + x) / t_1)
t_3 = (z + a) - b
if (y <= (-8.5d+24)) then
tmp = t_3
else if (y <= (-3.4d-272)) then
tmp = t_2
else if (y <= 3d-284) then
tmp = a - ((y * b) / t_1)
else if (y <= 3.8d-147) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = z * ((y + x) / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -8.5e+24) {
tmp = t_3;
} else if (y <= -3.4e-272) {
tmp = t_2;
} else if (y <= 3e-284) {
tmp = a - ((y * b) / t_1);
} else if (y <= 3.8e-147) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + x) + t t_2 = z * ((y + x) / t_1) t_3 = (z + a) - b tmp = 0 if y <= -8.5e+24: tmp = t_3 elif y <= -3.4e-272: tmp = t_2 elif y <= 3e-284: tmp = a - ((y * b) / t_1) elif y <= 3.8e-147: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(z * Float64(Float64(y + x) / t_1)) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -8.5e+24) tmp = t_3; elseif (y <= -3.4e-272) tmp = t_2; elseif (y <= 3e-284) tmp = Float64(a - Float64(Float64(y * b) / t_1)); elseif (y <= 3.8e-147) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + x) + t; t_2 = z * ((y + x) / t_1); t_3 = (z + a) - b; tmp = 0.0; if (y <= -8.5e+24) tmp = t_3; elseif (y <= -3.4e-272) tmp = t_2; elseif (y <= 3e-284) tmp = a - ((y * b) / t_1); elseif (y <= 3.8e-147) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.5e+24], t$95$3, If[LessEqual[y, -3.4e-272], t$95$2, If[LessEqual[y, 3e-284], N[(a - N[(N[(y * b), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-147], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := z \cdot \frac{y + x}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+24}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-272}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-284}:\\
\;\;\;\;a - \frac{y \cdot b}{t\_1}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-147}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -8.49999999999999959e24 or 3.80000000000000028e-147 < y Initial program 47.3%
Taylor expanded in y around inf 74.2%
if -8.49999999999999959e24 < y < -3.4000000000000003e-272 or 3e-284 < y < 3.80000000000000028e-147Initial program 73.6%
Taylor expanded in z around inf 42.0%
associate-/l*58.9%
+-commutative58.9%
+-commutative58.9%
Simplified58.9%
if -3.4000000000000003e-272 < y < 3e-284Initial program 82.7%
Taylor expanded in b around 0 82.7%
mul-1-neg82.7%
+-commutative82.7%
unsub-neg82.7%
+-commutative82.7%
associate-/l*82.7%
fma-define82.7%
+-commutative82.7%
associate-+r+82.7%
associate-/l*99.9%
associate-+r+99.9%
Simplified91.4%
clear-num91.4%
inv-pow91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
Applied egg-rr91.4%
unpow-191.4%
Simplified91.4%
Taylor expanded in t around inf 71.0%
Taylor expanded in z around 0 79.5%
Final simplification68.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (+ y (+ x t))))
(if (<= y -2.12e+24)
t_1
(if (<= y -2.6e-272)
(* z (/ (+ y x) (+ (+ y x) t)))
(if (<= y 4.2e-214)
(* a (/ (+ y t) t_2))
(if (<= y 4.8e-146) (* z (/ x t_2)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double tmp;
if (y <= -2.12e+24) {
tmp = t_1;
} else if (y <= -2.6e-272) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 4.2e-214) {
tmp = a * ((y + t) / t_2);
} else if (y <= 4.8e-146) {
tmp = z * (x / t_2);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = y + (x + t)
if (y <= (-2.12d+24)) then
tmp = t_1
else if (y <= (-2.6d-272)) then
tmp = z * ((y + x) / ((y + x) + t))
else if (y <= 4.2d-214) then
tmp = a * ((y + t) / t_2)
else if (y <= 4.8d-146) then
tmp = z * (x / t_2)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double tmp;
if (y <= -2.12e+24) {
tmp = t_1;
} else if (y <= -2.6e-272) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 4.2e-214) {
tmp = a * ((y + t) / t_2);
} else if (y <= 4.8e-146) {
tmp = z * (x / t_2);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = y + (x + t) tmp = 0 if y <= -2.12e+24: tmp = t_1 elif y <= -2.6e-272: tmp = z * ((y + x) / ((y + x) + t)) elif y <= 4.2e-214: tmp = a * ((y + t) / t_2) elif y <= 4.8e-146: tmp = z * (x / t_2) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -2.12e+24) tmp = t_1; elseif (y <= -2.6e-272) tmp = Float64(z * Float64(Float64(y + x) / Float64(Float64(y + x) + t))); elseif (y <= 4.2e-214) tmp = Float64(a * Float64(Float64(y + t) / t_2)); elseif (y <= 4.8e-146) tmp = Float64(z * Float64(x / t_2)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = y + (x + t); tmp = 0.0; if (y <= -2.12e+24) tmp = t_1; elseif (y <= -2.6e-272) tmp = z * ((y + x) / ((y + x) + t)); elseif (y <= 4.2e-214) tmp = a * ((y + t) / t_2); elseif (y <= 4.8e-146) tmp = z * (x / t_2); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.12e+24], t$95$1, If[LessEqual[y, -2.6e-272], N[(z * N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-214], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-146], N[(z * N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -2.12 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-272}:\\
\;\;\;\;z \cdot \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-214}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_2}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-146}:\\
\;\;\;\;z \cdot \frac{x}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.1200000000000001e24 or 4.8000000000000003e-146 < y Initial program 47.3%
Taylor expanded in y around inf 74.2%
if -2.1200000000000001e24 < y < -2.59999999999999992e-272Initial program 75.8%
Taylor expanded in z around inf 43.5%
associate-/l*60.0%
+-commutative60.0%
+-commutative60.0%
Simplified60.0%
if -2.59999999999999992e-272 < y < 4.19999999999999984e-214Initial program 80.0%
Taylor expanded in a around inf 40.3%
associate-/l*56.4%
associate-+r+56.4%
Simplified56.4%
if 4.19999999999999984e-214 < y < 4.8000000000000003e-146Initial program 56.5%
Taylor expanded in x around inf 41.6%
*-commutative41.6%
Simplified41.6%
associate-/l*76.5%
+-commutative76.5%
+-commutative76.5%
Applied egg-rr76.5%
Final simplification68.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (* z (/ x t_1))) (t_3 (- (+ z a) b)))
(if (<= y -2.85e-70)
t_3
(if (<= y -1.08e-271)
t_2
(if (<= y 1.8e-216)
(* a (/ (+ y t) t_1))
(if (<= y 3.2e-148) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = z * (x / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -2.85e-70) {
tmp = t_3;
} else if (y <= -1.08e-271) {
tmp = t_2;
} else if (y <= 1.8e-216) {
tmp = a * ((y + t) / t_1);
} else if (y <= 3.2e-148) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = z * (x / t_1)
t_3 = (z + a) - b
if (y <= (-2.85d-70)) then
tmp = t_3
else if (y <= (-1.08d-271)) then
tmp = t_2
else if (y <= 1.8d-216) then
tmp = a * ((y + t) / t_1)
else if (y <= 3.2d-148) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = z * (x / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -2.85e-70) {
tmp = t_3;
} else if (y <= -1.08e-271) {
tmp = t_2;
} else if (y <= 1.8e-216) {
tmp = a * ((y + t) / t_1);
} else if (y <= 3.2e-148) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = z * (x / t_1) t_3 = (z + a) - b tmp = 0 if y <= -2.85e-70: tmp = t_3 elif y <= -1.08e-271: tmp = t_2 elif y <= 1.8e-216: tmp = a * ((y + t) / t_1) elif y <= 3.2e-148: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(z * Float64(x / t_1)) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.85e-70) tmp = t_3; elseif (y <= -1.08e-271) tmp = t_2; elseif (y <= 1.8e-216) tmp = Float64(a * Float64(Float64(y + t) / t_1)); elseif (y <= 3.2e-148) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = z * (x / t_1); t_3 = (z + a) - b; tmp = 0.0; if (y <= -2.85e-70) tmp = t_3; elseif (y <= -1.08e-271) tmp = t_2; elseif (y <= 1.8e-216) tmp = a * ((y + t) / t_1); elseif (y <= 3.2e-148) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.85e-70], t$95$3, If[LessEqual[y, -1.08e-271], t$95$2, If[LessEqual[y, 1.8e-216], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-148], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := z \cdot \frac{x}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.85 \cdot 10^{-70}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{-271}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-216}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-148}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -2.85000000000000014e-70 or 3.19999999999999993e-148 < y Initial program 50.4%
Taylor expanded in y around inf 71.9%
if -2.85000000000000014e-70 < y < -1.07999999999999997e-271 or 1.7999999999999999e-216 < y < 3.19999999999999993e-148Initial program 71.0%
Taylor expanded in x around inf 40.0%
*-commutative40.0%
Simplified40.0%
associate-/l*62.1%
+-commutative62.1%
+-commutative62.1%
Applied egg-rr62.1%
if -1.07999999999999997e-271 < y < 1.7999999999999999e-216Initial program 80.0%
Taylor expanded in a around inf 40.3%
associate-/l*56.4%
associate-+r+56.4%
Simplified56.4%
Final simplification67.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (* z (/ x t_1))) (t_3 (- (+ z a) b)))
(if (<= y -2e-69)
t_3
(if (<= y -1.5e-272)
t_2
(if (<= y 1.9e-233) (/ (* t a) t_1) (if (<= y 3.7e-146) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = z * (x / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -2e-69) {
tmp = t_3;
} else if (y <= -1.5e-272) {
tmp = t_2;
} else if (y <= 1.9e-233) {
tmp = (t * a) / t_1;
} else if (y <= 3.7e-146) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = z * (x / t_1)
t_3 = (z + a) - b
if (y <= (-2d-69)) then
tmp = t_3
else if (y <= (-1.5d-272)) then
tmp = t_2
else if (y <= 1.9d-233) then
tmp = (t * a) / t_1
else if (y <= 3.7d-146) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = z * (x / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -2e-69) {
tmp = t_3;
} else if (y <= -1.5e-272) {
tmp = t_2;
} else if (y <= 1.9e-233) {
tmp = (t * a) / t_1;
} else if (y <= 3.7e-146) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = z * (x / t_1) t_3 = (z + a) - b tmp = 0 if y <= -2e-69: tmp = t_3 elif y <= -1.5e-272: tmp = t_2 elif y <= 1.9e-233: tmp = (t * a) / t_1 elif y <= 3.7e-146: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(z * Float64(x / t_1)) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2e-69) tmp = t_3; elseif (y <= -1.5e-272) tmp = t_2; elseif (y <= 1.9e-233) tmp = Float64(Float64(t * a) / t_1); elseif (y <= 3.7e-146) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = z * (x / t_1); t_3 = (z + a) - b; tmp = 0.0; if (y <= -2e-69) tmp = t_3; elseif (y <= -1.5e-272) tmp = t_2; elseif (y <= 1.9e-233) tmp = (t * a) / t_1; elseif (y <= 3.7e-146) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2e-69], t$95$3, If[LessEqual[y, -1.5e-272], t$95$2, If[LessEqual[y, 1.9e-233], N[(N[(t * a), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 3.7e-146], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := z \cdot \frac{x}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2 \cdot 10^{-69}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-272}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-233}:\\
\;\;\;\;\frac{t \cdot a}{t\_1}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-146}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -1.9999999999999999e-69 or 3.69999999999999986e-146 < y Initial program 50.4%
Taylor expanded in y around inf 71.9%
if -1.9999999999999999e-69 < y < -1.5000000000000001e-272 or 1.9e-233 < y < 3.69999999999999986e-146Initial program 69.3%
Taylor expanded in x around inf 39.8%
*-commutative39.8%
Simplified39.8%
associate-/l*60.8%
+-commutative60.8%
+-commutative60.8%
Applied egg-rr60.8%
if -1.5000000000000001e-272 < y < 1.9e-233Initial program 85.1%
Taylor expanded in t around inf 44.4%
Final simplification66.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ x (+ y (+ x t))))) (t_2 (- (+ z a) b)))
(if (<= y -8.5e-70)
t_2
(if (<= y -1.7e-272)
t_1
(if (<= y 1.16e-217) a (if (<= y 1.05e-147) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x / (y + (x + t)));
double t_2 = (z + a) - b;
double tmp;
if (y <= -8.5e-70) {
tmp = t_2;
} else if (y <= -1.7e-272) {
tmp = t_1;
} else if (y <= 1.16e-217) {
tmp = a;
} else if (y <= 1.05e-147) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (x / (y + (x + t)))
t_2 = (z + a) - b
if (y <= (-8.5d-70)) then
tmp = t_2
else if (y <= (-1.7d-272)) then
tmp = t_1
else if (y <= 1.16d-217) then
tmp = a
else if (y <= 1.05d-147) then
tmp = t_1
else
tmp = 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 t_1 = z * (x / (y + (x + t)));
double t_2 = (z + a) - b;
double tmp;
if (y <= -8.5e-70) {
tmp = t_2;
} else if (y <= -1.7e-272) {
tmp = t_1;
} else if (y <= 1.16e-217) {
tmp = a;
} else if (y <= 1.05e-147) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x / (y + (x + t))) t_2 = (z + a) - b tmp = 0 if y <= -8.5e-70: tmp = t_2 elif y <= -1.7e-272: tmp = t_1 elif y <= 1.16e-217: tmp = a elif y <= 1.05e-147: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x / Float64(y + Float64(x + t)))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -8.5e-70) tmp = t_2; elseif (y <= -1.7e-272) tmp = t_1; elseif (y <= 1.16e-217) tmp = a; elseif (y <= 1.05e-147) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x / (y + (x + t))); t_2 = (z + a) - b; tmp = 0.0; if (y <= -8.5e-70) tmp = t_2; elseif (y <= -1.7e-272) tmp = t_1; elseif (y <= 1.16e-217) tmp = a; elseif (y <= 1.05e-147) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.5e-70], t$95$2, If[LessEqual[y, -1.7e-272], t$95$1, If[LessEqual[y, 1.16e-217], a, If[LessEqual[y, 1.05e-147], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x}{y + \left(x + t\right)}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{-70}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-217}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.5000000000000002e-70 or 1.05e-147 < y Initial program 50.4%
Taylor expanded in y around inf 71.9%
if -8.5000000000000002e-70 < y < -1.7000000000000002e-272 or 1.1600000000000001e-217 < y < 1.05e-147Initial program 71.0%
Taylor expanded in x around inf 40.0%
*-commutative40.0%
Simplified40.0%
associate-/l*62.1%
+-commutative62.1%
+-commutative62.1%
Applied egg-rr62.1%
if -1.7000000000000002e-272 < y < 1.1600000000000001e-217Initial program 80.0%
Taylor expanded in t around inf 43.0%
Final simplification66.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) (* y (/ b (+ y (+ x t)))))))
(if (<= y -1e-137)
t_1
(if (<= y -6.2e-262)
(* z (/ (+ y x) (+ (+ y x) t)))
(if (<= y 2.9e-80) (/ (+ (* t a) (* z x)) (+ x t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - (y * (b / (y + (x + t))));
double tmp;
if (y <= -1e-137) {
tmp = t_1;
} else if (y <= -6.2e-262) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 2.9e-80) {
tmp = ((t * a) + (z * x)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (z + a) - (y * (b / (y + (x + t))))
if (y <= (-1d-137)) then
tmp = t_1
else if (y <= (-6.2d-262)) then
tmp = z * ((y + x) / ((y + x) + t))
else if (y <= 2.9d-80) then
tmp = ((t * a) + (z * x)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - (y * (b / (y + (x + t))));
double tmp;
if (y <= -1e-137) {
tmp = t_1;
} else if (y <= -6.2e-262) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 2.9e-80) {
tmp = ((t * a) + (z * x)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - (y * (b / (y + (x + t)))) tmp = 0 if y <= -1e-137: tmp = t_1 elif y <= -6.2e-262: tmp = z * ((y + x) / ((y + x) + t)) elif y <= 2.9e-80: tmp = ((t * a) + (z * x)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(y + Float64(x + t))))) tmp = 0.0 if (y <= -1e-137) tmp = t_1; elseif (y <= -6.2e-262) tmp = Float64(z * Float64(Float64(y + x) / Float64(Float64(y + x) + t))); elseif (y <= 2.9e-80) tmp = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - (y * (b / (y + (x + t)))); tmp = 0.0; if (y <= -1e-137) tmp = t_1; elseif (y <= -6.2e-262) tmp = z * ((y + x) / ((y + x) + t)); elseif (y <= 2.9e-80) tmp = ((t * a) + (z * x)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-137], t$95$1, If[LessEqual[y, -6.2e-262], N[(z * N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-80], N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - y \cdot \frac{b}{y + \left(x + t\right)}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-262}:\\
\;\;\;\;z \cdot \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-80}:\\
\;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.99999999999999978e-138 or 2.89999999999999998e-80 < y Initial program 50.7%
Taylor expanded in b around 0 50.7%
mul-1-neg50.7%
+-commutative50.7%
unsub-neg50.7%
+-commutative50.7%
associate-/l*62.6%
fma-define62.6%
+-commutative62.6%
associate-+r+62.6%
associate-/l*79.6%
associate-+r+79.6%
Simplified98.7%
Taylor expanded in y around inf 78.9%
if -9.99999999999999978e-138 < y < -6.1999999999999997e-262Initial program 61.9%
Taylor expanded in z around inf 45.7%
associate-/l*72.1%
+-commutative72.1%
+-commutative72.1%
Simplified72.1%
if -6.1999999999999997e-262 < y < 2.89999999999999998e-80Initial program 79.2%
Taylor expanded in y around 0 60.1%
Final simplification73.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.75e-76) (not (<= y 1.95e-72))) (- (+ z a) b) (/ (+ (* t a) (* z x)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.75e-76) || !(y <= 1.95e-72)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (z * x)) / (x + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((y <= (-2.75d-76)) .or. (.not. (y <= 1.95d-72))) then
tmp = (z + a) - b
else
tmp = ((t * a) + (z * x)) / (x + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.75e-76) || !(y <= 1.95e-72)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (z * x)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.75e-76) or not (y <= 1.95e-72): tmp = (z + a) - b else: tmp = ((t * a) + (z * x)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.75e-76) || !(y <= 1.95e-72)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.75e-76) || ~((y <= 1.95e-72))) tmp = (z + a) - b; else tmp = ((t * a) + (z * x)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.75e-76], N[Not[LessEqual[y, 1.95e-72]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{-76} \lor \neg \left(y \leq 1.95 \cdot 10^{-72}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\
\end{array}
\end{array}
if y < -2.75000000000000007e-76 or 1.95e-72 < y Initial program 46.9%
Taylor expanded in y around inf 73.0%
if -2.75000000000000007e-76 < y < 1.95e-72Initial program 76.8%
Taylor expanded in y around 0 59.5%
Final simplification67.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.8e+139) (* x (/ z (+ x t))) (if (<= x 3.4e+201) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+139) {
tmp = x * (z / (x + t));
} else if (x <= 3.4e+201) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-8.8d+139)) then
tmp = x * (z / (x + t))
else if (x <= 3.4d+201) then
tmp = (z + a) - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+139) {
tmp = x * (z / (x + t));
} else if (x <= 3.4e+201) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.8e+139: tmp = x * (z / (x + t)) elif x <= 3.4e+201: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.8e+139) tmp = Float64(x * Float64(z / Float64(x + t))); elseif (x <= 3.4e+201) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -8.8e+139) tmp = x * (z / (x + t)); elseif (x <= 3.4e+201) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.8e+139], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e+201], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+201}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -8.7999999999999998e139Initial program 48.9%
Taylor expanded in x around inf 29.6%
*-commutative29.6%
Simplified29.6%
Taylor expanded in y around 0 29.6%
associate-/l*51.0%
+-commutative51.0%
Simplified51.0%
if -8.7999999999999998e139 < x < 3.4e201Initial program 60.1%
Taylor expanded in y around inf 62.6%
if 3.4e201 < x Initial program 55.4%
Taylor expanded in x around inf 59.8%
Final simplification61.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.2e+167) z (if (<= x 5.2e+202) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.2e+167) {
tmp = z;
} else if (x <= 5.2e+202) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-5.2d+167)) then
tmp = z
else if (x <= 5.2d+202) then
tmp = (z + a) - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.2e+167) {
tmp = z;
} else if (x <= 5.2e+202) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.2e+167: tmp = z elif x <= 5.2e+202: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.2e+167) tmp = z; elseif (x <= 5.2e+202) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5.2e+167) tmp = z; elseif (x <= 5.2e+202) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.2e+167], z, If[LessEqual[x, 5.2e+202], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+167}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+202}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -5.2000000000000004e167 or 5.2000000000000004e202 < x Initial program 49.8%
Taylor expanded in x around inf 54.6%
if -5.2000000000000004e167 < x < 5.2000000000000004e202Initial program 60.1%
Taylor expanded in y around inf 61.8%
Final simplification60.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.8e+14) a (if (<= t 1.7e+48) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.8e+14) {
tmp = a;
} else if (t <= 1.7e+48) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (t <= (-3.8d+14)) then
tmp = a
else if (t <= 1.7d+48) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.8e+14) {
tmp = a;
} else if (t <= 1.7e+48) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.8e+14: tmp = a elif t <= 1.7e+48: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.8e+14) tmp = a; elseif (t <= 1.7e+48) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.8e+14) tmp = a; elseif (t <= 1.7e+48) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.8e+14], a, If[LessEqual[t, 1.7e+48], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+14}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+48}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -3.8e14 or 1.7000000000000002e48 < t Initial program 47.4%
Taylor expanded in t around inf 48.8%
if -3.8e14 < t < 1.7000000000000002e48Initial program 66.8%
Taylor expanded in x around inf 41.8%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
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
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 58.5%
Taylor expanded in t around inf 31.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))