
(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 14 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 (+ x y)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (<= t_2 (- INFINITY))
(*
a
(+
(* b (/ (- (* (/ z b) (/ (+ x y) t_1)) (/ y t_1)) a))
(/ (+ y t) t_1)))
(if (<= t_2 5e+267) t_2 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = a * ((b * ((((z / b) * ((x + y) / t_1)) - (y / t_1)) / a)) + ((y + t) / t_1));
} else if (t_2 <= 5e+267) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = a * ((b * ((((z / b) * ((x + y) / t_1)) - (y / t_1)) / a)) + ((y + t) / t_1));
} else if (t_2 <= 5e+267) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if t_2 <= -math.inf: tmp = a * ((b * ((((z / b) * ((x + y) / t_1)) - (y / t_1)) / a)) + ((y + t) / t_1)) elif t_2 <= 5e+267: tmp = t_2 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(a * Float64(Float64(b * Float64(Float64(Float64(Float64(z / b) * Float64(Float64(x + y) / t_1)) - Float64(y / t_1)) / a)) + Float64(Float64(y + t) / t_1))); elseif (t_2 <= 5e+267) tmp = t_2; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (x + y); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if (t_2 <= -Inf) tmp = a * ((b * ((((z / b) * ((x + y) / t_1)) - (y / t_1)) / a)) + ((y + t) / t_1)); elseif (t_2 <= 5e+267) tmp = t_2; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(a * N[(N[(b * N[(N[(N[(N[(z / b), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+267], t$95$2, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;a \cdot \left(b \cdot \frac{\frac{z}{b} \cdot \frac{x + y}{t\_1} - \frac{y}{t\_1}}{a} + \frac{y + t}{t\_1}\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\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.0Initial program 6.5%
Taylor expanded in b around inf 12.2%
+-commutative12.2%
mul-1-neg12.2%
unsub-neg12.2%
Simplified61.4%
Taylor expanded in a around -inf 67.2%
associate-*r*67.2%
mul-1-neg67.2%
fma-define67.2%
mul-1-neg67.2%
+-commutative67.2%
+-commutative67.2%
associate-+r+67.2%
fmm-undef67.2%
Simplified77.0%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999999e267Initial program 99.7%
if 4.9999999999999999e267 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.0%
Taylor expanded in y around inf 79.0%
Final simplification91.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 -2e+302) (not (<= t_1 5e+267))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -2e+302) || !(t_1 <= 5e+267)) {
tmp = (z + a) - 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 + y)) + (a * (y + t))) - (y * b)) / (y + (x + t))
if ((t_1 <= (-2d+302)) .or. (.not. (t_1 <= 5d+267))) then
tmp = (z + a) - 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 + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -2e+302) || !(t_1 <= 5e+267)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -2e+302) or not (t_1 <= 5e+267): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= -2e+302) || !(t_1 <= 5e+267)) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -2e+302) || ~((t_1 <= 5e+267))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+302], N[Not[LessEqual[t$95$1, 5e+267]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+302} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+267}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;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)) < -2.0000000000000002e302 or 4.9999999999999999e267 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.2%
Taylor expanded in y around inf 76.5%
if -2.0000000000000002e302 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999999e267Initial program 99.7%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (* a (/ (+ y t) (+ x (+ y t))))))
(if (<= a -7.5e+76)
t_2
(if (<= a -4.9e-8)
(- (+ z a) b)
(if (<= a 1550000.0)
(/ (- (* z (+ x y)) (* y b)) t_1)
(if (<= a 4.1e+114) (/ (- (* a (+ y t)) (* 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 = a * ((y + t) / (x + (y + t)));
double tmp;
if (a <= -7.5e+76) {
tmp = t_2;
} else if (a <= -4.9e-8) {
tmp = (z + a) - b;
} else if (a <= 1550000.0) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (a <= 4.1e+114) {
tmp = ((a * (y + t)) - (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 = a * ((y + t) / (x + (y + t)))
if (a <= (-7.5d+76)) then
tmp = t_2
else if (a <= (-4.9d-8)) then
tmp = (z + a) - b
else if (a <= 1550000.0d0) then
tmp = ((z * (x + y)) - (y * b)) / t_1
else if (a <= 4.1d+114) then
tmp = ((a * (y + t)) - (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 = a * ((y + t) / (x + (y + t)));
double tmp;
if (a <= -7.5e+76) {
tmp = t_2;
} else if (a <= -4.9e-8) {
tmp = (z + a) - b;
} else if (a <= 1550000.0) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (a <= 4.1e+114) {
tmp = ((a * (y + t)) - (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 = a * ((y + t) / (x + (y + t))) tmp = 0 if a <= -7.5e+76: tmp = t_2 elif a <= -4.9e-8: tmp = (z + a) - b elif a <= 1550000.0: tmp = ((z * (x + y)) - (y * b)) / t_1 elif a <= 4.1e+114: tmp = ((a * (y + t)) - (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(a * Float64(Float64(y + t) / Float64(x + Float64(y + t)))) tmp = 0.0 if (a <= -7.5e+76) tmp = t_2; elseif (a <= -4.9e-8) tmp = Float64(Float64(z + a) - b); elseif (a <= 1550000.0) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / t_1); elseif (a <= 4.1e+114) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * 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 = a * ((y + t) / (x + (y + t))); tmp = 0.0; if (a <= -7.5e+76) tmp = t_2; elseif (a <= -4.9e-8) tmp = (z + a) - b; elseif (a <= 1550000.0) tmp = ((z * (x + y)) - (y * b)) / t_1; elseif (a <= 4.1e+114) tmp = ((a * (y + t)) - (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[(a * N[(N[(y + t), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+76], t$95$2, If[LessEqual[a, -4.9e-8], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[a, 1550000.0], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[a, 4.1e+114], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \frac{y + t}{x + \left(y + t\right)}\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+76}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -4.9 \cdot 10^{-8}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;a \leq 1550000:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{t\_1}\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{+114}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -7.4999999999999995e76 or 4.1000000000000001e114 < a Initial program 43.7%
Taylor expanded in a around inf 32.2%
associate-/l*77.2%
+-commutative77.2%
+-commutative77.2%
associate-+r+77.2%
Simplified77.2%
if -7.4999999999999995e76 < a < -4.9000000000000002e-8Initial program 40.6%
Taylor expanded in y around inf 81.6%
if -4.9000000000000002e-8 < a < 1.55e6Initial program 79.4%
Taylor expanded in a around 0 67.5%
+-commutative67.5%
*-commutative67.5%
Simplified67.5%
if 1.55e6 < a < 4.1000000000000001e114Initial program 80.0%
Taylor expanded in z around 0 74.1%
+-commutative74.1%
*-commutative74.1%
Simplified74.1%
Final simplification72.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (/ (* y t_1) (+ y (+ x t)))))
(if (<= y -2e+86)
t_1
(if (<= y -5.5e-85)
t_2
(if (<= y 4.2e-84)
(* z (+ (/ x (+ x (+ y t))) (/ a z)))
(if (<= y 6.6e+56) 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 * t_1) / (y + (x + t));
double tmp;
if (y <= -2e+86) {
tmp = t_1;
} else if (y <= -5.5e-85) {
tmp = t_2;
} else if (y <= 4.2e-84) {
tmp = z * ((x / (x + (y + t))) + (a / z));
} else if (y <= 6.6e+56) {
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 + a) - b
t_2 = (y * t_1) / (y + (x + t))
if (y <= (-2d+86)) then
tmp = t_1
else if (y <= (-5.5d-85)) then
tmp = t_2
else if (y <= 4.2d-84) then
tmp = z * ((x / (x + (y + t))) + (a / z))
else if (y <= 6.6d+56) 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 + a) - b;
double t_2 = (y * t_1) / (y + (x + t));
double tmp;
if (y <= -2e+86) {
tmp = t_1;
} else if (y <= -5.5e-85) {
tmp = t_2;
} else if (y <= 4.2e-84) {
tmp = z * ((x / (x + (y + t))) + (a / z));
} else if (y <= 6.6e+56) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = (y * t_1) / (y + (x + t)) tmp = 0 if y <= -2e+86: tmp = t_1 elif y <= -5.5e-85: tmp = t_2 elif y <= 4.2e-84: tmp = z * ((x / (x + (y + t))) + (a / z)) elif y <= 6.6e+56: tmp = 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(Float64(y * t_1) / Float64(y + Float64(x + t))) tmp = 0.0 if (y <= -2e+86) tmp = t_1; elseif (y <= -5.5e-85) tmp = t_2; elseif (y <= 4.2e-84) tmp = Float64(z * Float64(Float64(x / Float64(x + Float64(y + t))) + Float64(a / z))); elseif (y <= 6.6e+56) tmp = 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 * t_1) / (y + (x + t)); tmp = 0.0; if (y <= -2e+86) tmp = t_1; elseif (y <= -5.5e-85) tmp = t_2; elseif (y <= 4.2e-84) tmp = z * ((x / (x + (y + t))) + (a / z)); elseif (y <= 6.6e+56) 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 + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+86], t$95$1, If[LessEqual[y, -5.5e-85], t$95$2, If[LessEqual[y, 4.2e-84], N[(z * N[(N[(x / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+56], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \frac{y \cdot t\_1}{y + \left(x + t\right)}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-84}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + \left(y + t\right)} + \frac{a}{z}\right)\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+56}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2e86 or 6.60000000000000004e56 < y Initial program 36.8%
Taylor expanded in y around inf 81.8%
if -2e86 < y < -5.4999999999999997e-85 or 4.19999999999999996e-84 < y < 6.60000000000000004e56Initial program 81.6%
Taylor expanded in y around inf 67.5%
if -5.4999999999999997e-85 < y < 4.19999999999999996e-84Initial program 73.6%
Taylor expanded in z around inf 73.1%
associate--l+73.1%
+-commutative73.1%
associate-+r+73.1%
Simplified80.5%
Taylor expanded in t around inf 66.5%
Final simplification71.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.65e-85)
t_1
(if (<= y 5.2e-288)
(* z (+ (/ x (+ x (+ y t))) (/ a z)))
(if (<= y 2.05e-69) (/ (+ (* t a) (* x z)) (+ x t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.65e-85) {
tmp = t_1;
} else if (y <= 5.2e-288) {
tmp = z * ((x / (x + (y + t))) + (a / z));
} else if (y <= 2.05e-69) {
tmp = ((t * a) + (x * z)) / (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) - b
if (y <= (-1.65d-85)) then
tmp = t_1
else if (y <= 5.2d-288) then
tmp = z * ((x / (x + (y + t))) + (a / z))
else if (y <= 2.05d-69) then
tmp = ((t * a) + (x * z)) / (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) - b;
double tmp;
if (y <= -1.65e-85) {
tmp = t_1;
} else if (y <= 5.2e-288) {
tmp = z * ((x / (x + (y + t))) + (a / z));
} else if (y <= 2.05e-69) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.65e-85: tmp = t_1 elif y <= 5.2e-288: tmp = z * ((x / (x + (y + t))) + (a / z)) elif y <= 2.05e-69: tmp = ((t * a) + (x * z)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.65e-85) tmp = t_1; elseif (y <= 5.2e-288) tmp = Float64(z * Float64(Float64(x / Float64(x + Float64(y + t))) + Float64(a / z))); elseif (y <= 2.05e-69) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / 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) - b; tmp = 0.0; if (y <= -1.65e-85) tmp = t_1; elseif (y <= 5.2e-288) tmp = z * ((x / (x + (y + t))) + (a / z)); elseif (y <= 2.05e-69) tmp = ((t * a) + (x * z)) / (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] - b), $MachinePrecision]}, If[LessEqual[y, -1.65e-85], t$95$1, If[LessEqual[y, 5.2e-288], N[(z * N[(N[(x / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-69], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-288}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + \left(y + t\right)} + \frac{a}{z}\right)\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-69}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.64999999999999986e-85 or 2.04999999999999995e-69 < y Initial program 55.7%
Taylor expanded in y around inf 70.1%
if -1.64999999999999986e-85 < y < 5.19999999999999979e-288Initial program 71.2%
Taylor expanded in z around inf 74.0%
associate--l+74.0%
+-commutative74.0%
associate-+r+74.0%
Simplified83.8%
Taylor expanded in t around inf 73.8%
if 5.19999999999999979e-288 < y < 2.04999999999999995e-69Initial program 78.6%
Taylor expanded in y around 0 63.7%
Final simplification69.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e-170) (not (<= y 4.4e-68))) (- (+ z a) b) (/ (+ (* t a) (* x z)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e-170) || !(y <= 4.4e-68)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (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 <= (-1.55d-170)) .or. (.not. (y <= 4.4d-68))) then
tmp = (z + a) - b
else
tmp = ((t * a) + (x * z)) / (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 <= -1.55e-170) || !(y <= 4.4e-68)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.55e-170) or not (y <= 4.4e-68): tmp = (z + a) - b else: tmp = ((t * a) + (x * z)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e-170) || !(y <= 4.4e-68)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.55e-170) || ~((y <= 4.4e-68))) tmp = (z + a) - b; else tmp = ((t * a) + (x * z)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e-170], N[Not[LessEqual[y, 4.4e-68]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-170} \lor \neg \left(y \leq 4.4 \cdot 10^{-68}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\end{array}
\end{array}
if y < -1.54999999999999993e-170 or 4.40000000000000005e-68 < y Initial program 56.4%
Taylor expanded in y around inf 67.0%
if -1.54999999999999993e-170 < y < 4.40000000000000005e-68Initial program 78.4%
Taylor expanded in y around 0 68.6%
Final simplification67.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -4.6e+24) (not (<= x 3.7e+112))) (+ z (* y (- (/ a x) (/ b x)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.6e+24) || !(x <= 3.7e+112)) {
tmp = z + (y * ((a / x) - (b / x)));
} else {
tmp = (z + a) - 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 <= (-4.6d+24)) .or. (.not. (x <= 3.7d+112))) then
tmp = z + (y * ((a / x) - (b / x)))
else
tmp = (z + a) - 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 <= -4.6e+24) || !(x <= 3.7e+112)) {
tmp = z + (y * ((a / x) - (b / x)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -4.6e+24) or not (x <= 3.7e+112): tmp = z + (y * ((a / x) - (b / x))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -4.6e+24) || !(x <= 3.7e+112)) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -4.6e+24) || ~((x <= 3.7e+112))) tmp = z + (y * ((a / x) - (b / x))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -4.6e+24], N[Not[LessEqual[x, 3.7e+112]], $MachinePrecision]], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+24} \lor \neg \left(x \leq 3.7 \cdot 10^{+112}\right):\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -4.5999999999999998e24 or 3.70000000000000004e112 < x Initial program 56.4%
Taylor expanded in x around inf 58.2%
associate--l+59.3%
+-commutative59.3%
associate-/l*58.4%
associate-/l*66.6%
+-commutative66.6%
*-commutative66.6%
associate-/l*70.0%
+-commutative70.0%
Simplified70.0%
Taylor expanded in y around inf 66.2%
if -4.5999999999999998e24 < x < 3.70000000000000004e112Initial program 67.4%
Taylor expanded in y around inf 67.3%
Final simplification67.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))))
(if (or (<= a -3.2e+16) (not (<= a 13000000000.0)))
(* a (/ (+ y t) t_1))
(* z (/ (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double tmp;
if ((a <= -3.2e+16) || !(a <= 13000000000.0)) {
tmp = a * ((y + t) / t_1);
} else {
tmp = z * ((x + y) / 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 = x + (y + t)
if ((a <= (-3.2d+16)) .or. (.not. (a <= 13000000000.0d0))) then
tmp = a * ((y + t) / t_1)
else
tmp = z * ((x + y) / 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 = x + (y + t);
double tmp;
if ((a <= -3.2e+16) || !(a <= 13000000000.0)) {
tmp = a * ((y + t) / t_1);
} else {
tmp = z * ((x + y) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) tmp = 0 if (a <= -3.2e+16) or not (a <= 13000000000.0): tmp = a * ((y + t) / t_1) else: tmp = z * ((x + y) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) tmp = 0.0 if ((a <= -3.2e+16) || !(a <= 13000000000.0)) tmp = Float64(a * Float64(Float64(y + t) / t_1)); else tmp = Float64(z * Float64(Float64(x + y) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); tmp = 0.0; if ((a <= -3.2e+16) || ~((a <= 13000000000.0))) tmp = a * ((y + t) / t_1); else tmp = z * ((x + y) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -3.2e+16], N[Not[LessEqual[a, 13000000000.0]], $MachinePrecision]], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{+16} \lor \neg \left(a \leq 13000000000\right):\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\
\end{array}
\end{array}
if a < -3.2e16 or 1.3e10 < a Initial program 51.1%
Taylor expanded in a around inf 34.7%
associate-/l*70.6%
+-commutative70.6%
+-commutative70.6%
associate-+r+70.6%
Simplified70.6%
if -3.2e16 < a < 1.3e10Initial program 77.0%
Taylor expanded in z around inf 44.9%
associate-/l*60.1%
+-commutative60.1%
+-commutative60.1%
associate-+r+60.1%
Simplified60.1%
Final simplification65.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.7e+25) (not (<= x 5.9e+109))) (- z (* b (/ y x))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.7e+25) || !(x <= 5.9e+109)) {
tmp = z - (b * (y / x));
} else {
tmp = (z + a) - 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.7d+25)) .or. (.not. (x <= 5.9d+109))) then
tmp = z - (b * (y / x))
else
tmp = (z + a) - 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.7e+25) || !(x <= 5.9e+109)) {
tmp = z - (b * (y / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.7e+25) or not (x <= 5.9e+109): tmp = z - (b * (y / x)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.7e+25) || !(x <= 5.9e+109)) tmp = Float64(z - Float64(b * Float64(y / x))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -1.7e+25) || ~((x <= 5.9e+109))) tmp = z - (b * (y / x)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.7e+25], N[Not[LessEqual[x, 5.9e+109]], $MachinePrecision]], N[(z - N[(b * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+25} \lor \neg \left(x \leq 5.9 \cdot 10^{+109}\right):\\
\;\;\;\;z - b \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -1.69999999999999992e25 or 5.8999999999999997e109 < x Initial program 56.4%
Taylor expanded in x around inf 58.2%
associate--l+59.3%
+-commutative59.3%
associate-/l*58.4%
associate-/l*66.6%
+-commutative66.6%
*-commutative66.6%
associate-/l*70.0%
+-commutative70.0%
Simplified70.0%
Taylor expanded in y around inf 66.2%
Taylor expanded in a around 0 53.5%
mul-1-neg53.5%
associate-/l*56.4%
Simplified56.4%
if -1.69999999999999992e25 < x < 5.8999999999999997e109Initial program 67.4%
Taylor expanded in y around inf 67.3%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -4.2e+144) (not (<= x 4.4e+118))) (+ z (* y (/ a x))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.2e+144) || !(x <= 4.4e+118)) {
tmp = z + (y * (a / x));
} else {
tmp = (z + a) - 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 <= (-4.2d+144)) .or. (.not. (x <= 4.4d+118))) then
tmp = z + (y * (a / x))
else
tmp = (z + a) - 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 <= -4.2e+144) || !(x <= 4.4e+118)) {
tmp = z + (y * (a / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -4.2e+144) or not (x <= 4.4e+118): tmp = z + (y * (a / x)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -4.2e+144) || !(x <= 4.4e+118)) tmp = Float64(z + Float64(y * Float64(a / x))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -4.2e+144) || ~((x <= 4.4e+118))) tmp = z + (y * (a / x)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -4.2e+144], N[Not[LessEqual[x, 4.4e+118]], $MachinePrecision]], N[(z + N[(y * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+144} \lor \neg \left(x \leq 4.4 \cdot 10^{+118}\right):\\
\;\;\;\;z + y \cdot \frac{a}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -4.19999999999999993e144 or 4.39999999999999972e118 < x Initial program 58.0%
Taylor expanded in x around inf 62.4%
associate--l+63.7%
+-commutative63.7%
associate-/l*62.6%
associate-/l*72.3%
+-commutative72.3%
*-commutative72.3%
associate-/l*76.5%
+-commutative76.5%
Simplified76.5%
Taylor expanded in y around inf 69.3%
Taylor expanded in a around inf 57.9%
if -4.19999999999999993e144 < x < 4.39999999999999972e118Initial program 65.8%
Taylor expanded in y around inf 65.2%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.05e+17) a (if (<= a 950000000000.0) z (- a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.05e+17) {
tmp = a;
} else if (a <= 950000000000.0) {
tmp = z;
} else {
tmp = a - 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 (a <= (-1.05d+17)) then
tmp = a
else if (a <= 950000000000.0d0) then
tmp = z
else
tmp = a - 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 (a <= -1.05e+17) {
tmp = a;
} else if (a <= 950000000000.0) {
tmp = z;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.05e+17: tmp = a elif a <= 950000000000.0: tmp = z else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.05e+17) tmp = a; elseif (a <= 950000000000.0) tmp = z; else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.05e+17) tmp = a; elseif (a <= 950000000000.0) tmp = z; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.05e+17], a, If[LessEqual[a, 950000000000.0], z, N[(a - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{+17}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 950000000000:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if a < -1.05e17Initial program 53.3%
Taylor expanded in t around inf 57.0%
if -1.05e17 < a < 9.5e11Initial program 77.0%
Taylor expanded in x around inf 45.7%
if 9.5e11 < a Initial program 49.1%
Taylor expanded in z around 0 45.5%
+-commutative45.5%
*-commutative45.5%
Simplified45.5%
Taylor expanded in y around inf 57.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.6e+16) a (if (<= a 5100000.0) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.6e+16) {
tmp = a;
} else if (a <= 5100000.0) {
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 (a <= (-5.6d+16)) then
tmp = a
else if (a <= 5100000.0d0) 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 (a <= -5.6e+16) {
tmp = a;
} else if (a <= 5100000.0) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.6e+16: tmp = a elif a <= 5100000.0: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.6e+16) tmp = a; elseif (a <= 5100000.0) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.6e+16) tmp = a; elseif (a <= 5100000.0) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.6e+16], a, If[LessEqual[a, 5100000.0], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{+16}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 5100000:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -5.6e16 or 5.1e6 < a Initial program 51.1%
Taylor expanded in t around inf 53.7%
if -5.6e16 < a < 5.1e6Initial program 77.0%
Taylor expanded in x around inf 45.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.8e+77) z (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.8e+77) {
tmp = z;
} else {
tmp = (z + a) - 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.8d+77)) then
tmp = z
else
tmp = (z + a) - 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.8e+77) {
tmp = z;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.8e+77: tmp = z else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.8e+77) tmp = z; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.8e+77) tmp = z; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.8e+77], z, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+77}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -1.7999999999999999e77Initial program 58.4%
Taylor expanded in x around inf 46.1%
if -1.7999999999999999e77 < x Initial program 64.5%
Taylor expanded in y around inf 61.6%
Final simplification59.3%
(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 63.6%
Taylor expanded in t around inf 33.2%
(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 2024157
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ 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)))