
(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 13 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 (+ t (+ y x)))
(t_2 (+ y (+ t x)))
(t_3
(*
a
(+
(* b (fma -1.0 (/ y (* a t_1)) (* (/ z a) (/ (+ y x) (* b t_1)))))
(/ (+ t y) (+ (+ t y) x)))))
(t_4 (/ (+ y x) t_2)))
(if (<= a -4.15e+46)
t_3
(if (<= a 5e-208)
(* z (+ (/ (/ (- (* a (+ t y)) (* y b)) t_2) z) t_4))
(if (<= a 9e+207)
(* b (- (/ (+ (* a (/ (+ t y) t_2)) (* z t_4)) b) (/ y t_2)))
t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = y + (t + x);
double t_3 = a * ((b * fma(-1.0, (y / (a * t_1)), ((z / a) * ((y + x) / (b * t_1))))) + ((t + y) / ((t + y) + x)));
double t_4 = (y + x) / t_2;
double tmp;
if (a <= -4.15e+46) {
tmp = t_3;
} else if (a <= 5e-208) {
tmp = z * (((((a * (t + y)) - (y * b)) / t_2) / z) + t_4);
} else if (a <= 9e+207) {
tmp = b * ((((a * ((t + y) / t_2)) + (z * t_4)) / b) - (y / t_2));
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(y + Float64(t + x)) t_3 = Float64(a * Float64(Float64(b * fma(-1.0, Float64(y / Float64(a * t_1)), Float64(Float64(z / a) * Float64(Float64(y + x) / Float64(b * t_1))))) + Float64(Float64(t + y) / Float64(Float64(t + y) + x)))) t_4 = Float64(Float64(y + x) / t_2) tmp = 0.0 if (a <= -4.15e+46) tmp = t_3; elseif (a <= 5e-208) tmp = Float64(z * Float64(Float64(Float64(Float64(Float64(a * Float64(t + y)) - Float64(y * b)) / t_2) / z) + t_4)); elseif (a <= 9e+207) tmp = Float64(b * Float64(Float64(Float64(Float64(a * Float64(Float64(t + y) / t_2)) + Float64(z * t_4)) / b) - Float64(y / t_2))); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a * N[(N[(b * N[(-1.0 * N[(y / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(z / a), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] / N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] / N[(N[(t + y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y + x), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[a, -4.15e+46], t$95$3, If[LessEqual[a, 5e-208], N[(z * N[(N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / z), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+207], N[(b * N[(N[(N[(N[(a * N[(N[(t + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(z * t$95$4), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := y + \left(t + x\right)\\
t_3 := a \cdot \left(b \cdot \mathsf{fma}\left(-1, \frac{y}{a \cdot t\_1}, \frac{z}{a} \cdot \frac{y + x}{b \cdot t\_1}\right) + \frac{t + y}{\left(t + y\right) + x}\right)\\
t_4 := \frac{y + x}{t\_2}\\
\mathbf{if}\;a \leq -4.15 \cdot 10^{+46}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-208}:\\
\;\;\;\;z \cdot \left(\frac{\frac{a \cdot \left(t + y\right) - y \cdot b}{t\_2}}{z} + t\_4\right)\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+207}:\\
\;\;\;\;b \cdot \left(\frac{a \cdot \frac{t + y}{t\_2} + z \cdot t\_4}{b} - \frac{y}{t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if a < -4.14999999999999976e46 or 9.00000000000000006e207 < a Initial program 39.2%
Taylor expanded in a around -inf 78.7%
associate-*r*78.7%
mul-1-neg78.7%
mul-1-neg78.7%
unsub-neg78.7%
mul-1-neg78.7%
distribute-neg-frac278.7%
+-commutative78.7%
associate-+r+78.7%
distribute-neg-in78.7%
+-commutative78.7%
unsub-neg78.7%
Simplified78.7%
Taylor expanded in b around inf 78.0%
fma-define78.0%
times-frac94.7%
Simplified94.7%
if -4.14999999999999976e46 < a < 4.99999999999999963e-208Initial program 74.4%
Taylor expanded in z around -inf 94.0%
associate-*r*94.0%
mul-1-neg94.0%
mul-1-neg94.0%
unsub-neg94.0%
associate-*r/94.0%
distribute-lft-in94.0%
neg-mul-194.0%
unsub-neg94.0%
neg-mul-194.0%
associate-+r+94.0%
Simplified94.0%
if 4.99999999999999963e-208 < a < 9.00000000000000006e207Initial program 66.5%
Taylor expanded in b around -inf 74.9%
mul-1-neg74.9%
distribute-rgt-neg-in74.9%
+-commutative74.9%
mul-1-neg74.9%
unsub-neg74.9%
associate-+r+74.9%
Simplified95.0%
Final simplification94.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x)))
(t_2 (/ (- (+ (* a (+ t y)) (* (+ y x) z)) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+187)))
(+ a (- z b))
(/ (+ (* a t) (+ (* x z) (* y (- (+ a z) b)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double t_2 = (((a * (t + y)) + ((y + x) * z)) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+187)) {
tmp = a + (z - b);
} else {
tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double t_2 = (((a * (t + y)) + ((y + x) * z)) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+187)) {
tmp = a + (z - b);
} else {
tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) t_2 = (((a * (t + y)) + ((y + x) * z)) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+187): tmp = a + (z - b) else: tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) t_2 = Float64(Float64(Float64(Float64(a * Float64(t + y)) + Float64(Float64(y + x) * z)) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+187)) tmp = Float64(a + Float64(z - b)); else tmp = Float64(Float64(Float64(a * t) + Float64(Float64(x * z) + Float64(y * Float64(Float64(a + z) - b)))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); t_2 = (((a * (t + y)) + ((y + x) * z)) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+187))) tmp = a + (z - b); else tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+187]], $MachinePrecision]], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
t_2 := \frac{\left(a \cdot \left(t + y\right) + \left(y + x\right) \cdot z\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+187}\right):\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot t + \left(x \cdot z + y \cdot \left(\left(a + z\right) - b\right)\right)}{t\_1}\\
\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)) < -inf.0 or 9.99999999999999907e186 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 16.2%
Taylor expanded in y around inf 72.3%
associate--l+72.3%
Simplified72.3%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999907e186Initial program 99.7%
Taylor expanded in y around 0 99.7%
Final simplification87.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x)))
(t_2 (/ y t_1))
(t_3 (/ (+ y x) t_1))
(t_4
(*
a
(+ (/ t t_1) (- (+ t_2 (* (/ z a) t_3)) (/ (* y b) (* a t_1)))))))
(if (<= a -6.5e-48)
t_4
(if (<= a 7.5e-207)
(* z (+ (/ (/ (- (* a (+ t y)) (* y b)) t_1) z) t_3))
(if (<= a 1.2e+209)
(* b (- (/ (+ (* a (/ (+ t y) t_1)) (* z t_3)) b) t_2))
t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double t_2 = y / t_1;
double t_3 = (y + x) / t_1;
double t_4 = a * ((t / t_1) + ((t_2 + ((z / a) * t_3)) - ((y * b) / (a * t_1))));
double tmp;
if (a <= -6.5e-48) {
tmp = t_4;
} else if (a <= 7.5e-207) {
tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_3);
} else if (a <= 1.2e+209) {
tmp = b * ((((a * ((t + y) / t_1)) + (z * t_3)) / b) - 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 = y + (t + x)
t_2 = y / t_1
t_3 = (y + x) / t_1
t_4 = a * ((t / t_1) + ((t_2 + ((z / a) * t_3)) - ((y * b) / (a * t_1))))
if (a <= (-6.5d-48)) then
tmp = t_4
else if (a <= 7.5d-207) then
tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_3)
else if (a <= 1.2d+209) then
tmp = b * ((((a * ((t + y) / t_1)) + (z * t_3)) / b) - 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 = y + (t + x);
double t_2 = y / t_1;
double t_3 = (y + x) / t_1;
double t_4 = a * ((t / t_1) + ((t_2 + ((z / a) * t_3)) - ((y * b) / (a * t_1))));
double tmp;
if (a <= -6.5e-48) {
tmp = t_4;
} else if (a <= 7.5e-207) {
tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_3);
} else if (a <= 1.2e+209) {
tmp = b * ((((a * ((t + y) / t_1)) + (z * t_3)) / b) - t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) t_2 = y / t_1 t_3 = (y + x) / t_1 t_4 = a * ((t / t_1) + ((t_2 + ((z / a) * t_3)) - ((y * b) / (a * t_1)))) tmp = 0 if a <= -6.5e-48: tmp = t_4 elif a <= 7.5e-207: tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_3) elif a <= 1.2e+209: tmp = b * ((((a * ((t + y) / t_1)) + (z * t_3)) / b) - t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) t_2 = Float64(y / t_1) t_3 = Float64(Float64(y + x) / t_1) t_4 = Float64(a * Float64(Float64(t / t_1) + Float64(Float64(t_2 + Float64(Float64(z / a) * t_3)) - Float64(Float64(y * b) / Float64(a * t_1))))) tmp = 0.0 if (a <= -6.5e-48) tmp = t_4; elseif (a <= 7.5e-207) tmp = Float64(z * Float64(Float64(Float64(Float64(Float64(a * Float64(t + y)) - Float64(y * b)) / t_1) / z) + t_3)); elseif (a <= 1.2e+209) tmp = Float64(b * Float64(Float64(Float64(Float64(a * Float64(Float64(t + y) / t_1)) + Float64(z * t_3)) / b) - t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); t_2 = y / t_1; t_3 = (y + x) / t_1; t_4 = a * ((t / t_1) + ((t_2 + ((z / a) * t_3)) - ((y * b) / (a * t_1)))); tmp = 0.0; if (a <= -6.5e-48) tmp = t_4; elseif (a <= 7.5e-207) tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_3); elseif (a <= 1.2e+209) tmp = b * ((((a * ((t + y) / t_1)) + (z * t_3)) / b) - t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(t$95$2 + N[(N[(z / a), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.5e-48], t$95$4, If[LessEqual[a, 7.5e-207], N[(z * N[(N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / z), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e+209], N[(b * N[(N[(N[(N[(a * N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
t_2 := \frac{y}{t\_1}\\
t_3 := \frac{y + x}{t\_1}\\
t_4 := a \cdot \left(\frac{t}{t\_1} + \left(\left(t\_2 + \frac{z}{a} \cdot t\_3\right) - \frac{y \cdot b}{a \cdot t\_1}\right)\right)\\
\mathbf{if}\;a \leq -6.5 \cdot 10^{-48}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-207}:\\
\;\;\;\;z \cdot \left(\frac{\frac{a \cdot \left(t + y\right) - y \cdot b}{t\_1}}{z} + t\_3\right)\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+209}:\\
\;\;\;\;b \cdot \left(\frac{a \cdot \frac{t + y}{t\_1} + z \cdot t\_3}{b} - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if a < -6.5e-48 or 1.19999999999999998e209 < a Initial program 49.1%
Taylor expanded in a around inf 77.2%
associate--l+77.2%
associate-+r+77.2%
associate-+r+77.2%
*-commutative77.2%
*-commutative77.2%
times-frac93.2%
+-commutative93.2%
associate-+r+93.2%
*-commutative93.2%
Simplified93.2%
if -6.5e-48 < a < 7.5000000000000006e-207Initial program 73.5%
Taylor expanded in z around -inf 94.5%
associate-*r*94.5%
mul-1-neg94.5%
mul-1-neg94.5%
unsub-neg94.5%
associate-*r/94.5%
distribute-lft-in94.5%
neg-mul-194.5%
unsub-neg94.5%
neg-mul-194.5%
associate-+r+94.5%
Simplified94.5%
if 7.5000000000000006e-207 < a < 1.19999999999999998e209Initial program 66.9%
Taylor expanded in b around -inf 75.2%
mul-1-neg75.2%
distribute-rgt-neg-in75.2%
+-commutative75.2%
mul-1-neg75.2%
unsub-neg75.2%
associate-+r+75.2%
Simplified95.1%
Final simplification94.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x)))
(t_2 (/ (+ y x) t_1))
(t_3
(* a (- (/ (+ t y) (+ (+ t y) x)) (* (/ b a) (/ y (+ t (+ y x))))))))
(if (<= a -1.62e+49)
t_3
(if (<= a 1.6e-207)
(* z (+ (/ (/ (- (* a (+ t y)) (* y b)) t_1) z) t_2))
(if (<= a 8.2e+207)
(* b (- (/ (+ (* a (/ (+ t y) t_1)) (* z t_2)) b) (/ y t_1)))
t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double t_2 = (y + x) / t_1;
double t_3 = a * (((t + y) / ((t + y) + x)) - ((b / a) * (y / (t + (y + x)))));
double tmp;
if (a <= -1.62e+49) {
tmp = t_3;
} else if (a <= 1.6e-207) {
tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_2);
} else if (a <= 8.2e+207) {
tmp = b * ((((a * ((t + y) / t_1)) + (z * t_2)) / b) - (y / t_1));
} 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 + (t + x)
t_2 = (y + x) / t_1
t_3 = a * (((t + y) / ((t + y) + x)) - ((b / a) * (y / (t + (y + x)))))
if (a <= (-1.62d+49)) then
tmp = t_3
else if (a <= 1.6d-207) then
tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_2)
else if (a <= 8.2d+207) then
tmp = b * ((((a * ((t + y) / t_1)) + (z * t_2)) / b) - (y / t_1))
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 + (t + x);
double t_2 = (y + x) / t_1;
double t_3 = a * (((t + y) / ((t + y) + x)) - ((b / a) * (y / (t + (y + x)))));
double tmp;
if (a <= -1.62e+49) {
tmp = t_3;
} else if (a <= 1.6e-207) {
tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_2);
} else if (a <= 8.2e+207) {
tmp = b * ((((a * ((t + y) / t_1)) + (z * t_2)) / b) - (y / t_1));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) t_2 = (y + x) / t_1 t_3 = a * (((t + y) / ((t + y) + x)) - ((b / a) * (y / (t + (y + x))))) tmp = 0 if a <= -1.62e+49: tmp = t_3 elif a <= 1.6e-207: tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_2) elif a <= 8.2e+207: tmp = b * ((((a * ((t + y) / t_1)) + (z * t_2)) / b) - (y / t_1)) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) t_2 = Float64(Float64(y + x) / t_1) t_3 = Float64(a * Float64(Float64(Float64(t + y) / Float64(Float64(t + y) + x)) - Float64(Float64(b / a) * Float64(y / Float64(t + Float64(y + x)))))) tmp = 0.0 if (a <= -1.62e+49) tmp = t_3; elseif (a <= 1.6e-207) tmp = Float64(z * Float64(Float64(Float64(Float64(Float64(a * Float64(t + y)) - Float64(y * b)) / t_1) / z) + t_2)); elseif (a <= 8.2e+207) tmp = Float64(b * Float64(Float64(Float64(Float64(a * Float64(Float64(t + y) / t_1)) + Float64(z * t_2)) / b) - Float64(y / t_1))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); t_2 = (y + x) / t_1; t_3 = a * (((t + y) / ((t + y) + x)) - ((b / a) * (y / (t + (y + x))))); tmp = 0.0; if (a <= -1.62e+49) tmp = t_3; elseif (a <= 1.6e-207) tmp = z * (((((a * (t + y)) - (y * b)) / t_1) / z) + t_2); elseif (a <= 8.2e+207) tmp = b * ((((a * ((t + y) / t_1)) + (z * t_2)) / b) - (y / t_1)); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(a * N[(N[(N[(t + y), $MachinePrecision] / N[(N[(t + y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] - N[(N[(b / a), $MachinePrecision] * N[(y / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.62e+49], t$95$3, If[LessEqual[a, 1.6e-207], N[(z * N[(N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / z), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+207], N[(b * N[(N[(N[(N[(a * N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * t$95$2), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
t_2 := \frac{y + x}{t\_1}\\
t_3 := a \cdot \left(\frac{t + y}{\left(t + y\right) + x} - \frac{b}{a} \cdot \frac{y}{t + \left(y + x\right)}\right)\\
\mathbf{if}\;a \leq -1.62 \cdot 10^{+49}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-207}:\\
\;\;\;\;z \cdot \left(\frac{\frac{a \cdot \left(t + y\right) - y \cdot b}{t\_1}}{z} + t\_2\right)\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+207}:\\
\;\;\;\;b \cdot \left(\frac{a \cdot \frac{t + y}{t\_1} + z \cdot t\_2}{b} - \frac{y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if a < -1.62e49 or 8.2e207 < a Initial program 39.2%
Taylor expanded in a around -inf 78.7%
associate-*r*78.7%
mul-1-neg78.7%
mul-1-neg78.7%
unsub-neg78.7%
mul-1-neg78.7%
distribute-neg-frac278.7%
+-commutative78.7%
associate-+r+78.7%
distribute-neg-in78.7%
+-commutative78.7%
unsub-neg78.7%
Simplified78.7%
Taylor expanded in b around inf 78.0%
fma-define78.0%
times-frac94.7%
Simplified94.7%
Taylor expanded in b around inf 76.5%
mul-1-neg76.5%
times-frac82.9%
Simplified82.9%
if -1.62e49 < a < 1.6000000000000002e-207Initial program 74.4%
Taylor expanded in z around -inf 94.0%
associate-*r*94.0%
mul-1-neg94.0%
mul-1-neg94.0%
unsub-neg94.0%
associate-*r/94.0%
distribute-lft-in94.0%
neg-mul-194.0%
unsub-neg94.0%
neg-mul-194.0%
associate-+r+94.0%
Simplified94.0%
if 1.6000000000000002e-207 < a < 8.2e207Initial program 66.5%
Taylor expanded in b around -inf 74.9%
mul-1-neg74.9%
distribute-rgt-neg-in74.9%
+-commutative74.9%
mul-1-neg74.9%
unsub-neg74.9%
associate-+r+74.9%
Simplified95.0%
Final simplification91.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x))) (t_2 (* a (/ (+ t y) t_1))))
(if (<= a -2e+151)
t_2
(if (<= a -8.8e-20)
(* a (+ (* (/ x a) (/ z (+ t x))) (/ t (+ t x))))
(if (<= a 1.42e-201)
(* z (/ (+ y x) t_1))
(if (<= a 1.85e+208) (* b (- (/ (+ a z) b) (/ y t_1))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double t_2 = a * ((t + y) / t_1);
double tmp;
if (a <= -2e+151) {
tmp = t_2;
} else if (a <= -8.8e-20) {
tmp = a * (((x / a) * (z / (t + x))) + (t / (t + x)));
} else if (a <= 1.42e-201) {
tmp = z * ((y + x) / t_1);
} else if (a <= 1.85e+208) {
tmp = b * (((a + z) / b) - (y / 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 + (t + x)
t_2 = a * ((t + y) / t_1)
if (a <= (-2d+151)) then
tmp = t_2
else if (a <= (-8.8d-20)) then
tmp = a * (((x / a) * (z / (t + x))) + (t / (t + x)))
else if (a <= 1.42d-201) then
tmp = z * ((y + x) / t_1)
else if (a <= 1.85d+208) then
tmp = b * (((a + z) / b) - (y / 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 + (t + x);
double t_2 = a * ((t + y) / t_1);
double tmp;
if (a <= -2e+151) {
tmp = t_2;
} else if (a <= -8.8e-20) {
tmp = a * (((x / a) * (z / (t + x))) + (t / (t + x)));
} else if (a <= 1.42e-201) {
tmp = z * ((y + x) / t_1);
} else if (a <= 1.85e+208) {
tmp = b * (((a + z) / b) - (y / t_1));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) t_2 = a * ((t + y) / t_1) tmp = 0 if a <= -2e+151: tmp = t_2 elif a <= -8.8e-20: tmp = a * (((x / a) * (z / (t + x))) + (t / (t + x))) elif a <= 1.42e-201: tmp = z * ((y + x) / t_1) elif a <= 1.85e+208: tmp = b * (((a + z) / b) - (y / t_1)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) t_2 = Float64(a * Float64(Float64(t + y) / t_1)) tmp = 0.0 if (a <= -2e+151) tmp = t_2; elseif (a <= -8.8e-20) tmp = Float64(a * Float64(Float64(Float64(x / a) * Float64(z / Float64(t + x))) + Float64(t / Float64(t + x)))); elseif (a <= 1.42e-201) tmp = Float64(z * Float64(Float64(y + x) / t_1)); elseif (a <= 1.85e+208) tmp = Float64(b * Float64(Float64(Float64(a + z) / b) - Float64(y / t_1))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); t_2 = a * ((t + y) / t_1); tmp = 0.0; if (a <= -2e+151) tmp = t_2; elseif (a <= -8.8e-20) tmp = a * (((x / a) * (z / (t + x))) + (t / (t + x))); elseif (a <= 1.42e-201) tmp = z * ((y + x) / t_1); elseif (a <= 1.85e+208) tmp = b * (((a + z) / b) - (y / 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[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2e+151], t$95$2, If[LessEqual[a, -8.8e-20], N[(a * N[(N[(N[(x / a), $MachinePrecision] * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.42e-201], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e+208], N[(b * N[(N[(N[(a + z), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
t_2 := a \cdot \frac{t + y}{t\_1}\\
\mathbf{if}\;a \leq -2 \cdot 10^{+151}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -8.8 \cdot 10^{-20}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} \cdot \frac{z}{t + x} + \frac{t}{t + x}\right)\\
\mathbf{elif}\;a \leq 1.42 \cdot 10^{-201}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_1}\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+208}:\\
\;\;\;\;b \cdot \left(\frac{a + z}{b} - \frac{y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -2.00000000000000003e151 or 1.84999999999999994e208 < a Initial program 29.7%
Taylor expanded in a around inf 22.7%
associate-/l*81.5%
associate-+r+81.5%
Simplified81.5%
if -2.00000000000000003e151 < a < -8.79999999999999964e-20Initial program 66.4%
Taylor expanded in a around -inf 78.6%
associate-*r*78.6%
mul-1-neg78.6%
mul-1-neg78.6%
unsub-neg78.6%
mul-1-neg78.6%
distribute-neg-frac278.6%
+-commutative78.6%
associate-+r+78.6%
distribute-neg-in78.6%
+-commutative78.6%
unsub-neg78.6%
Simplified78.6%
Taylor expanded in b around inf 75.6%
fma-define75.6%
times-frac85.2%
Simplified85.2%
Taylor expanded in y around 0 65.9%
associate-*r*65.9%
neg-mul-165.9%
associate-*r/65.9%
mul-1-neg65.9%
times-frac80.1%
Simplified80.1%
if -8.79999999999999964e-20 < a < 1.42e-201Initial program 74.1%
Taylor expanded in z around inf 47.8%
associate-/l*71.1%
+-commutative71.1%
associate-+r+71.1%
Simplified71.1%
if 1.42e-201 < a < 1.84999999999999994e208Initial program 66.5%
Taylor expanded in b around -inf 74.9%
mul-1-neg74.9%
distribute-rgt-neg-in74.9%
+-commutative74.9%
mul-1-neg74.9%
unsub-neg74.9%
associate-+r+74.9%
Simplified95.0%
Taylor expanded in y around inf 71.0%
Final simplification74.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.8e-103) (not (<= b 1.65e-44))) (* b (- (/ (+ a z) b) (/ y (+ y (+ t x))))) (+ a (- z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.8e-103) || !(b <= 1.65e-44)) {
tmp = b * (((a + z) / b) - (y / (y + (t + x))));
} else {
tmp = a + (z - b);
}
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 ((b <= (-3.8d-103)) .or. (.not. (b <= 1.65d-44))) then
tmp = b * (((a + z) / b) - (y / (y + (t + x))))
else
tmp = a + (z - b)
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 ((b <= -3.8e-103) || !(b <= 1.65e-44)) {
tmp = b * (((a + z) / b) - (y / (y + (t + x))));
} else {
tmp = a + (z - b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.8e-103) or not (b <= 1.65e-44): tmp = b * (((a + z) / b) - (y / (y + (t + x)))) else: tmp = a + (z - b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.8e-103) || !(b <= 1.65e-44)) tmp = Float64(b * Float64(Float64(Float64(a + z) / b) - Float64(y / Float64(y + Float64(t + x))))); else tmp = Float64(a + Float64(z - b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.8e-103) || ~((b <= 1.65e-44))) tmp = b * (((a + z) / b) - (y / (y + (t + x)))); else tmp = a + (z - b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.8e-103], N[Not[LessEqual[b, 1.65e-44]], $MachinePrecision]], N[(b * N[(N[(N[(a + z), $MachinePrecision] / b), $MachinePrecision] - N[(y / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-103} \lor \neg \left(b \leq 1.65 \cdot 10^{-44}\right):\\
\;\;\;\;b \cdot \left(\frac{a + z}{b} - \frac{y}{y + \left(t + x\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(z - b\right)\\
\end{array}
\end{array}
if b < -3.8000000000000001e-103 or 1.65000000000000003e-44 < b Initial program 66.6%
Taylor expanded in b around -inf 70.3%
mul-1-neg70.3%
distribute-rgt-neg-in70.3%
+-commutative70.3%
mul-1-neg70.3%
unsub-neg70.3%
associate-+r+70.3%
Simplified96.8%
Taylor expanded in y around inf 70.8%
if -3.8000000000000001e-103 < b < 1.65000000000000003e-44Initial program 53.0%
Taylor expanded in y around inf 67.5%
associate--l+67.5%
Simplified67.5%
Final simplification69.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ x (+ t x)))))
(if (<= x -5.5e+89)
t_1
(if (<= x -8200.0)
(* a (/ (+ t y) (+ y (+ t x))))
(if (<= x 1.95e+28) (+ a (- z b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x / (t + x));
double tmp;
if (x <= -5.5e+89) {
tmp = t_1;
} else if (x <= -8200.0) {
tmp = a * ((t + y) / (y + (t + x)));
} else if (x <= 1.95e+28) {
tmp = a + (z - b);
} 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 * (x / (t + x))
if (x <= (-5.5d+89)) then
tmp = t_1
else if (x <= (-8200.0d0)) then
tmp = a * ((t + y) / (y + (t + x)))
else if (x <= 1.95d+28) then
tmp = a + (z - b)
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 * (x / (t + x));
double tmp;
if (x <= -5.5e+89) {
tmp = t_1;
} else if (x <= -8200.0) {
tmp = a * ((t + y) / (y + (t + x)));
} else if (x <= 1.95e+28) {
tmp = a + (z - b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x / (t + x)) tmp = 0 if x <= -5.5e+89: tmp = t_1 elif x <= -8200.0: tmp = a * ((t + y) / (y + (t + x))) elif x <= 1.95e+28: tmp = a + (z - b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x / Float64(t + x))) tmp = 0.0 if (x <= -5.5e+89) tmp = t_1; elseif (x <= -8200.0) tmp = Float64(a * Float64(Float64(t + y) / Float64(y + Float64(t + x)))); elseif (x <= 1.95e+28) tmp = Float64(a + Float64(z - b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x / (t + x)); tmp = 0.0; if (x <= -5.5e+89) tmp = t_1; elseif (x <= -8200.0) tmp = a * ((t + y) / (y + (t + x))); elseif (x <= 1.95e+28) tmp = a + (z - b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+89], t$95$1, If[LessEqual[x, -8200.0], N[(a * N[(N[(t + y), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+28], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x}{t + x}\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -8200:\\
\;\;\;\;a \cdot \frac{t + y}{y + \left(t + x\right)}\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+28}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.49999999999999976e89 or 1.9499999999999999e28 < x Initial program 48.7%
Taylor expanded in z around inf 31.9%
associate-/l*62.4%
+-commutative62.4%
associate-+r+62.4%
Simplified62.4%
Taylor expanded in y around 0 60.5%
if -5.49999999999999976e89 < x < -8200Initial program 58.3%
Taylor expanded in a around inf 33.8%
associate-/l*66.0%
associate-+r+66.0%
Simplified66.0%
if -8200 < x < 1.9499999999999999e28Initial program 71.4%
Taylor expanded in y around inf 70.3%
associate--l+70.3%
Simplified70.3%
Final simplification66.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x))))
(if (<= x -4.2e+82)
(* z (/ (+ y x) t_1))
(if (<= x -20000000.0)
(* a (/ (+ t y) t_1))
(if (<= x 2.5e+28) (+ a (- z b)) (* z (/ x (+ t x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double tmp;
if (x <= -4.2e+82) {
tmp = z * ((y + x) / t_1);
} else if (x <= -20000000.0) {
tmp = a * ((t + y) / t_1);
} else if (x <= 2.5e+28) {
tmp = a + (z - b);
} else {
tmp = z * (x / (t + 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) :: tmp
t_1 = y + (t + x)
if (x <= (-4.2d+82)) then
tmp = z * ((y + x) / t_1)
else if (x <= (-20000000.0d0)) then
tmp = a * ((t + y) / t_1)
else if (x <= 2.5d+28) then
tmp = a + (z - b)
else
tmp = z * (x / (t + 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 + (t + x);
double tmp;
if (x <= -4.2e+82) {
tmp = z * ((y + x) / t_1);
} else if (x <= -20000000.0) {
tmp = a * ((t + y) / t_1);
} else if (x <= 2.5e+28) {
tmp = a + (z - b);
} else {
tmp = z * (x / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) tmp = 0 if x <= -4.2e+82: tmp = z * ((y + x) / t_1) elif x <= -20000000.0: tmp = a * ((t + y) / t_1) elif x <= 2.5e+28: tmp = a + (z - b) else: tmp = z * (x / (t + x)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) tmp = 0.0 if (x <= -4.2e+82) tmp = Float64(z * Float64(Float64(y + x) / t_1)); elseif (x <= -20000000.0) tmp = Float64(a * Float64(Float64(t + y) / t_1)); elseif (x <= 2.5e+28) tmp = Float64(a + Float64(z - b)); else tmp = Float64(z * Float64(x / Float64(t + x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); tmp = 0.0; if (x <= -4.2e+82) tmp = z * ((y + x) / t_1); elseif (x <= -20000000.0) tmp = a * ((t + y) / t_1); elseif (x <= 2.5e+28) tmp = a + (z - b); else tmp = z * (x / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e+82], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -20000000.0], N[(a * N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e+28], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{+82}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_1}\\
\mathbf{elif}\;x \leq -20000000:\\
\;\;\;\;a \cdot \frac{t + y}{t\_1}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+28}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x}{t + x}\\
\end{array}
\end{array}
if x < -4.2e82Initial program 43.3%
Taylor expanded in z around inf 25.1%
associate-/l*62.0%
+-commutative62.0%
associate-+r+62.0%
Simplified62.0%
if -4.2e82 < x < -2e7Initial program 58.3%
Taylor expanded in a around inf 33.8%
associate-/l*66.0%
associate-+r+66.0%
Simplified66.0%
if -2e7 < x < 2.49999999999999979e28Initial program 71.4%
Taylor expanded in y around inf 70.3%
associate--l+70.3%
Simplified70.3%
if 2.49999999999999979e28 < x Initial program 53.4%
Taylor expanded in z around inf 37.9%
associate-/l*62.8%
+-commutative62.8%
associate-+r+62.8%
Simplified62.8%
Taylor expanded in y around 0 62.8%
Final simplification66.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.5e+56) (not (<= x 3.1e+28))) (* z (/ x (+ t x))) (+ a (- z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.5e+56) || !(x <= 3.1e+28)) {
tmp = z * (x / (t + x));
} else {
tmp = a + (z - b);
}
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 <= (-1.5d+56)) .or. (.not. (x <= 3.1d+28))) then
tmp = z * (x / (t + x))
else
tmp = a + (z - b)
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 <= -1.5e+56) || !(x <= 3.1e+28)) {
tmp = z * (x / (t + x));
} else {
tmp = a + (z - b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.5e+56) or not (x <= 3.1e+28): tmp = z * (x / (t + x)) else: tmp = a + (z - b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.5e+56) || !(x <= 3.1e+28)) tmp = Float64(z * Float64(x / Float64(t + x))); else tmp = Float64(a + Float64(z - b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -1.5e+56) || ~((x <= 3.1e+28))) tmp = z * (x / (t + x)); else tmp = a + (z - b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.5e+56], N[Not[LessEqual[x, 3.1e+28]], $MachinePrecision]], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+56} \lor \neg \left(x \leq 3.1 \cdot 10^{+28}\right):\\
\;\;\;\;z \cdot \frac{x}{t + x}\\
\mathbf{else}:\\
\;\;\;\;a + \left(z - b\right)\\
\end{array}
\end{array}
if x < -1.50000000000000003e56 or 3.1000000000000001e28 < x Initial program 50.3%
Taylor expanded in z around inf 31.2%
associate-/l*59.8%
+-commutative59.8%
associate-+r+59.8%
Simplified59.8%
Taylor expanded in y around 0 58.0%
if -1.50000000000000003e56 < x < 3.1000000000000001e28Initial program 69.6%
Taylor expanded in y around inf 67.7%
associate--l+67.7%
Simplified67.7%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4e+98) z (if (<= x 4.2e+73) (+ a (- z b)) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4e+98) {
tmp = z;
} else if (x <= 4.2e+73) {
tmp = a + (z - 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 <= (-4d+98)) then
tmp = z
else if (x <= 4.2d+73) then
tmp = a + (z - 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 <= -4e+98) {
tmp = z;
} else if (x <= 4.2e+73) {
tmp = a + (z - b);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4e+98: tmp = z elif x <= 4.2e+73: tmp = a + (z - b) else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4e+98) tmp = z; elseif (x <= 4.2e+73) tmp = Float64(a + Float64(z - b)); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -4e+98) tmp = z; elseif (x <= 4.2e+73) tmp = a + (z - b); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4e+98], z, If[LessEqual[x, 4.2e+73], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+98}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+73}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -3.99999999999999999e98 or 4.2000000000000003e73 < x Initial program 45.9%
Taylor expanded in x around inf 54.8%
if -3.99999999999999999e98 < x < 4.2000000000000003e73Initial program 69.7%
Taylor expanded in y around inf 65.2%
associate--l+65.2%
Simplified65.2%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.45e+16) a (if (<= t 5.8e+62) (- z b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.45e+16) {
tmp = a;
} else if (t <= 5.8e+62) {
tmp = z - b;
} 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 <= (-1.45d+16)) then
tmp = a
else if (t <= 5.8d+62) then
tmp = z - b
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 <= -1.45e+16) {
tmp = a;
} else if (t <= 5.8e+62) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.45e+16: tmp = a elif t <= 5.8e+62: tmp = z - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.45e+16) tmp = a; elseif (t <= 5.8e+62) tmp = Float64(z - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.45e+16) tmp = a; elseif (t <= 5.8e+62) tmp = z - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.45e+16], a, If[LessEqual[t, 5.8e+62], N[(z - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+16}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+62}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.45e16 or 5.79999999999999968e62 < t Initial program 52.3%
Taylor expanded in t around inf 55.2%
if -1.45e16 < t < 5.79999999999999968e62Initial program 67.9%
Taylor expanded in z around inf 55.4%
+-commutative55.4%
Simplified55.4%
Taylor expanded in y around inf 57.1%
Final simplification56.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -106000000000.0) a (if (<= t 1.75e+53) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -106000000000.0) {
tmp = a;
} else if (t <= 1.75e+53) {
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 <= (-106000000000.0d0)) then
tmp = a
else if (t <= 1.75d+53) 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 <= -106000000000.0) {
tmp = a;
} else if (t <= 1.75e+53) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -106000000000.0: tmp = a elif t <= 1.75e+53: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -106000000000.0) tmp = a; elseif (t <= 1.75e+53) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -106000000000.0) tmp = a; elseif (t <= 1.75e+53) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -106000000000.0], a, If[LessEqual[t, 1.75e+53], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -106000000000:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+53}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.06e11 or 1.75000000000000009e53 < t Initial program 52.7%
Taylor expanded in t around inf 54.7%
if -1.06e11 < t < 1.75000000000000009e53Initial program 67.7%
Taylor expanded in x around inf 52.0%
Final simplification53.1%
(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 61.5%
Taylor expanded in t around inf 29.9%
Final simplification29.9%
(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 2024055
(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)))