
(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 (+ x y))) (t_2 (+ y (+ x t))) (t_3 (* a t_2)))
(if (or (<= z -4.1e+52) (not (<= z 1820.0)))
(*
z
(+
(/ x t_1)
(- (+ (/ y t_1) (/ (* a (/ (+ t y) z)) t_1)) (/ (* b (/ y z)) t_1))))
(*
a
(+ (/ t t_2) (- (fma z (/ (+ x y) t_3) (/ y t_2)) (* b (/ y t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = y + (x + t);
double t_3 = a * t_2;
double tmp;
if ((z <= -4.1e+52) || !(z <= 1820.0)) {
tmp = z * ((x / t_1) + (((y / t_1) + ((a * ((t + y) / z)) / t_1)) - ((b * (y / z)) / t_1)));
} else {
tmp = a * ((t / t_2) + (fma(z, ((x + y) / t_3), (y / t_2)) - (b * (y / t_3))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(a * t_2) tmp = 0.0 if ((z <= -4.1e+52) || !(z <= 1820.0)) tmp = Float64(z * Float64(Float64(x / t_1) + Float64(Float64(Float64(y / t_1) + Float64(Float64(a * Float64(Float64(t + y) / z)) / t_1)) - Float64(Float64(b * Float64(y / z)) / t_1)))); else tmp = Float64(a * Float64(Float64(t / t_2) + Float64(fma(z, Float64(Float64(x + y) / t_3), Float64(y / t_2)) - Float64(b * Float64(y / t_3))))); end return 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[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a * t$95$2), $MachinePrecision]}, If[Or[LessEqual[z, -4.1e+52], N[Not[LessEqual[z, 1820.0]], $MachinePrecision]], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(a * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(y / z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t / t$95$2), $MachinePrecision] + N[(N[(z * N[(N[(x + y), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := a \cdot t\_2\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+52} \lor \neg \left(z \leq 1820\right):\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\left(\frac{y}{t\_1} + \frac{a \cdot \frac{t + y}{z}}{t\_1}\right) - \frac{b \cdot \frac{y}{z}}{t\_1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_2} + \left(\mathsf{fma}\left(z, \frac{x + y}{t\_3}, \frac{y}{t\_2}\right) - b \cdot \frac{y}{t\_3}\right)\right)\\
\end{array}
\end{array}
if z < -4.1e52 or 1820 < z Initial program 43.3%
Taylor expanded in z around inf 61.5%
associate--l+61.5%
+-commutative61.5%
+-commutative61.5%
associate-/r*63.3%
associate-/l*77.3%
+-commutative77.3%
associate-/r*78.7%
associate-/l*91.0%
+-commutative91.0%
Simplified91.0%
if -4.1e52 < z < 1820Initial program 59.1%
Taylor expanded in a around inf 73.8%
associate--l+73.8%
associate-+r+73.8%
+-commutative73.8%
associate-/l*74.6%
fma-define74.6%
+-commutative74.6%
associate-+r+74.6%
associate-+r+74.6%
Simplified86.1%
Final simplification88.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y)))
(t_2 (* a (+ t y)))
(t_3 (/ (- (+ t_2 (* z (+ x y))) (* y b)) (+ y (+ x t)))))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 2e+231)))
(- (+ z a) b)
(+ (* z (+ (/ x t_1) (/ y t_1))) (/ (- t_2 (* y b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = a * (t + y);
double t_3 = ((t_2 + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 2e+231)) {
tmp = (z + a) - b;
} else {
tmp = (z * ((x / t_1) + (y / t_1))) + ((t_2 - (y * b)) / t_1);
}
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 = a * (t + y);
double t_3 = ((t_2 + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 2e+231)) {
tmp = (z + a) - b;
} else {
tmp = (z * ((x / t_1) + (y / t_1))) + ((t_2 - (y * b)) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) t_2 = a * (t + y) t_3 = ((t_2 + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 2e+231): tmp = (z + a) - b else: tmp = (z * ((x / t_1) + (y / t_1))) + ((t_2 - (y * b)) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(a * Float64(t + y)) t_3 = Float64(Float64(Float64(t_2 + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 2e+231)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(z * Float64(Float64(x / t_1) + Float64(y / t_1))) + Float64(Float64(t_2 - Float64(y * b)) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (x + y); t_2 = a * (t + y); t_3 = ((t_2 + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 2e+231))) tmp = (z + a) - b; else tmp = (z * ((x / t_1) + (y / t_1))) + ((t_2 - (y * b)) / t_1); 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[(a * N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 2e+231]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := a \cdot \left(t + y\right)\\
t_3 := \frac{\left(t\_2 + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_3 \leq -\infty \lor \neg \left(t\_3 \leq 2 \cdot 10^{+231}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \frac{y}{t\_1}\right) + \frac{t\_2 - y \cdot b}{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 2.0000000000000001e231 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in y around inf 74.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)) < 2.0000000000000001e231Initial program 99.7%
Taylor expanded in z around 0 99.8%
associate--l+99.8%
+-commutative99.8%
+-commutative99.8%
div-sub99.8%
*-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification86.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* a (+ t y)) (* z (+ x y))) (* y b)) t_1))
(t_3 (- (+ z a) b)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 2e+231)))
t_3
(/ (+ (* t a) (+ (* z x) (* y t_3))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 2e+231)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((z * x) + (y * t_3))) / t_1;
}
return tmp;
}
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 * (t + y)) + (z * (x + y))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 2e+231)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((z * x) + (y * t_3))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1 t_3 = (z + a) - b tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 2e+231): tmp = t_3 else: tmp = ((t * a) + ((z * x) + (y * t_3))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(a * Float64(t + y)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 2e+231)) tmp = t_3; else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(z * x) + Float64(y * t_3))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1; t_3 = (z + a) - b; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 2e+231))) tmp = t_3; else tmp = ((t * a) + ((z * x) + (y * t_3))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 2e+231]], $MachinePrecision]], t$95$3, N[(N[(N[(t * a), $MachinePrecision] + N[(N[(z * x), $MachinePrecision] + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(a \cdot \left(t + y\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 2 \cdot 10^{+231}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(z \cdot x + y \cdot t\_3\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 2.0000000000000001e231 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in y around inf 74.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)) < 2.0000000000000001e231Initial program 99.7%
Taylor expanded in y around 0 99.7%
Final simplification86.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -3.75e+143)
t_1
(if (<= y -9.4e-117)
(+ z a)
(if (<= y 5e-163)
(* a (+ (/ t (+ x t)) (/ (* z x) (* a (+ x t)))))
(if (<= y 2e-37) (/ (- (* z (+ x y)) (* y b)) (+ y (+ 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 <= -3.75e+143) {
tmp = t_1;
} else if (y <= -9.4e-117) {
tmp = z + a;
} else if (y <= 5e-163) {
tmp = a * ((t / (x + t)) + ((z * x) / (a * (x + t))));
} else if (y <= 2e-37) {
tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= (-3.75d+143)) then
tmp = t_1
else if (y <= (-9.4d-117)) then
tmp = z + a
else if (y <= 5d-163) then
tmp = a * ((t / (x + t)) + ((z * x) / (a * (x + t))))
else if (y <= 2d-37) then
tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= -3.75e+143) {
tmp = t_1;
} else if (y <= -9.4e-117) {
tmp = z + a;
} else if (y <= 5e-163) {
tmp = a * ((t / (x + t)) + ((z * x) / (a * (x + t))));
} else if (y <= 2e-37) {
tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= -3.75e+143: tmp = t_1 elif y <= -9.4e-117: tmp = z + a elif y <= 5e-163: tmp = a * ((t / (x + t)) + ((z * x) / (a * (x + t)))) elif y <= 2e-37: tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= -3.75e+143) tmp = t_1; elseif (y <= -9.4e-117) tmp = Float64(z + a); elseif (y <= 5e-163) tmp = Float64(a * Float64(Float64(t / Float64(x + t)) + Float64(Float64(z * x) / Float64(a * Float64(x + t))))); elseif (y <= 2e-37) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + 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 <= -3.75e+143) tmp = t_1; elseif (y <= -9.4e-117) tmp = z + a; elseif (y <= 5e-163) tmp = a * ((t / (x + t)) + ((z * x) / (a * (x + t)))); elseif (y <= 2e-37) tmp = ((z * (x + y)) - (y * b)) / (y + (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, -3.75e+143], t$95$1, If[LessEqual[y, -9.4e-117], N[(z + a), $MachinePrecision], If[LessEqual[y, 5e-163], N[(a * N[(N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(z * x), $MachinePrecision] / N[(a * N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-37], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.75 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.4 \cdot 10^{-117}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-163}:\\
\;\;\;\;a \cdot \left(\frac{t}{x + t} + \frac{z \cdot x}{a \cdot \left(x + t\right)}\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-37}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.74999999999999987e143 or 2.00000000000000013e-37 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -3.74999999999999987e143 < y < -9.40000000000000017e-117Initial program 47.8%
Taylor expanded in y around inf 48.2%
Taylor expanded in b around 0 68.5%
+-commutative68.5%
Simplified68.5%
if -9.40000000000000017e-117 < y < 4.99999999999999977e-163Initial program 71.5%
Taylor expanded in a around inf 75.9%
associate--l+75.9%
associate-+r+75.9%
+-commutative75.9%
associate-/l*76.1%
fma-define76.1%
+-commutative76.1%
associate-+r+76.1%
associate-+r+76.1%
Simplified76.1%
Taylor expanded in y around 0 68.8%
if 4.99999999999999977e-163 < y < 2.00000000000000013e-37Initial program 80.1%
Taylor expanded in a around 0 64.9%
+-commutative64.9%
*-commutative64.9%
Simplified64.9%
Final simplification76.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -3.75e+143)
t_1
(if (<= y -5.6e-199)
(+ z a)
(if (<= y 2.7e-158)
(+ (/ (* t a) (+ x t)) (/ (* z x) (+ x t)))
(if (<= y 1e-34) (/ (- (* z (+ x y)) (* y b)) (+ y (+ 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 <= -3.75e+143) {
tmp = t_1;
} else if (y <= -5.6e-199) {
tmp = z + a;
} else if (y <= 2.7e-158) {
tmp = ((t * a) / (x + t)) + ((z * x) / (x + t));
} else if (y <= 1e-34) {
tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= (-3.75d+143)) then
tmp = t_1
else if (y <= (-5.6d-199)) then
tmp = z + a
else if (y <= 2.7d-158) then
tmp = ((t * a) / (x + t)) + ((z * x) / (x + t))
else if (y <= 1d-34) then
tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= -3.75e+143) {
tmp = t_1;
} else if (y <= -5.6e-199) {
tmp = z + a;
} else if (y <= 2.7e-158) {
tmp = ((t * a) / (x + t)) + ((z * x) / (x + t));
} else if (y <= 1e-34) {
tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= -3.75e+143: tmp = t_1 elif y <= -5.6e-199: tmp = z + a elif y <= 2.7e-158: tmp = ((t * a) / (x + t)) + ((z * x) / (x + t)) elif y <= 1e-34: tmp = ((z * (x + y)) - (y * b)) / (y + (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 <= -3.75e+143) tmp = t_1; elseif (y <= -5.6e-199) tmp = Float64(z + a); elseif (y <= 2.7e-158) tmp = Float64(Float64(Float64(t * a) / Float64(x + t)) + Float64(Float64(z * x) / Float64(x + t))); elseif (y <= 1e-34) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + 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 <= -3.75e+143) tmp = t_1; elseif (y <= -5.6e-199) tmp = z + a; elseif (y <= 2.7e-158) tmp = ((t * a) / (x + t)) + ((z * x) / (x + t)); elseif (y <= 1e-34) tmp = ((z * (x + y)) - (y * b)) / (y + (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, -3.75e+143], t$95$1, If[LessEqual[y, -5.6e-199], N[(z + a), $MachinePrecision], If[LessEqual[y, 2.7e-158], N[(N[(N[(t * a), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(z * x), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-34], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.75 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-199}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-158}:\\
\;\;\;\;\frac{t \cdot a}{x + t} + \frac{z \cdot x}{x + t}\\
\mathbf{elif}\;y \leq 10^{-34}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.74999999999999987e143 or 9.99999999999999928e-35 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -3.74999999999999987e143 < y < -5.60000000000000036e-199Initial program 54.2%
Taylor expanded in y around inf 45.7%
Taylor expanded in b around 0 62.6%
+-commutative62.6%
Simplified62.6%
if -5.60000000000000036e-199 < y < 2.6999999999999998e-158Initial program 71.3%
Taylor expanded in z around 0 82.4%
associate--l+82.4%
fma-define82.4%
associate-+r+82.4%
associate-+r+82.4%
div-sub82.4%
*-commutative82.4%
associate-+r+82.4%
Simplified82.4%
Taylor expanded in y around 0 61.5%
*-commutative61.5%
Simplified61.5%
if 2.6999999999999998e-158 < y < 9.99999999999999928e-35Initial program 80.1%
Taylor expanded in a around 0 64.9%
+-commutative64.9%
*-commutative64.9%
Simplified64.9%
Final simplification73.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -4.6e+148)
t_1
(if (<= y -3.05e-198)
(+ z a)
(if (<= y 1.35e-101)
(+ (/ (* t a) (+ x t)) (/ (* z x) (+ x t)))
(if (<= y 1.3e-38) (* z (/ (+ x y) (+ t (+ x y)))) 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 <= -4.6e+148) {
tmp = t_1;
} else if (y <= -3.05e-198) {
tmp = z + a;
} else if (y <= 1.35e-101) {
tmp = ((t * a) / (x + t)) + ((z * x) / (x + t));
} else if (y <= 1.3e-38) {
tmp = z * ((x + y) / (t + (x + y)));
} 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 <= (-4.6d+148)) then
tmp = t_1
else if (y <= (-3.05d-198)) then
tmp = z + a
else if (y <= 1.35d-101) then
tmp = ((t * a) / (x + t)) + ((z * x) / (x + t))
else if (y <= 1.3d-38) then
tmp = z * ((x + y) / (t + (x + y)))
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 <= -4.6e+148) {
tmp = t_1;
} else if (y <= -3.05e-198) {
tmp = z + a;
} else if (y <= 1.35e-101) {
tmp = ((t * a) / (x + t)) + ((z * x) / (x + t));
} else if (y <= 1.3e-38) {
tmp = z * ((x + y) / (t + (x + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -4.6e+148: tmp = t_1 elif y <= -3.05e-198: tmp = z + a elif y <= 1.35e-101: tmp = ((t * a) / (x + t)) + ((z * x) / (x + t)) elif y <= 1.3e-38: tmp = z * ((x + y) / (t + (x + y))) 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 <= -4.6e+148) tmp = t_1; elseif (y <= -3.05e-198) tmp = Float64(z + a); elseif (y <= 1.35e-101) tmp = Float64(Float64(Float64(t * a) / Float64(x + t)) + Float64(Float64(z * x) / Float64(x + t))); elseif (y <= 1.3e-38) tmp = Float64(z * Float64(Float64(x + y) / Float64(t + Float64(x + y)))); 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 <= -4.6e+148) tmp = t_1; elseif (y <= -3.05e-198) tmp = z + a; elseif (y <= 1.35e-101) tmp = ((t * a) / (x + t)) + ((z * x) / (x + t)); elseif (y <= 1.3e-38) tmp = z * ((x + y) / (t + (x + y))); 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, -4.6e+148], t$95$1, If[LessEqual[y, -3.05e-198], N[(z + a), $MachinePrecision], If[LessEqual[y, 1.35e-101], N[(N[(N[(t * a), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(z * x), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-38], N[(z * N[(N[(x + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.05 \cdot 10^{-198}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-101}:\\
\;\;\;\;\frac{t \cdot a}{x + t} + \frac{z \cdot x}{x + t}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-38}:\\
\;\;\;\;z \cdot \frac{x + y}{t + \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.6000000000000001e148 or 1.30000000000000005e-38 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -4.6000000000000001e148 < y < -3.05e-198Initial program 54.2%
Taylor expanded in y around inf 45.7%
Taylor expanded in b around 0 62.6%
+-commutative62.6%
Simplified62.6%
if -3.05e-198 < y < 1.3500000000000001e-101Initial program 74.7%
Taylor expanded in z around 0 85.3%
associate--l+85.3%
fma-define85.3%
associate-+r+85.3%
associate-+r+85.3%
div-sub85.3%
*-commutative85.3%
associate-+r+85.3%
Simplified85.3%
Taylor expanded in y around 0 59.4%
*-commutative59.4%
Simplified59.4%
if 1.3500000000000001e-101 < y < 1.30000000000000005e-38Initial program 71.8%
Taylor expanded in z around inf 38.3%
associate-/l*60.5%
+-commutative60.5%
+-commutative60.5%
Simplified60.5%
Final simplification72.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -6.4e+154)
t_1
(if (<= y -1.36e-198)
(+ z a)
(if (<= y 6e-100)
(/ (+ (* t a) (* z x)) (+ x t))
(if (<= y 3e-38) (* z (/ (+ x y) (+ t (+ x y)))) 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 <= -6.4e+154) {
tmp = t_1;
} else if (y <= -1.36e-198) {
tmp = z + a;
} else if (y <= 6e-100) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if (y <= 3e-38) {
tmp = z * ((x + y) / (t + (x + y)));
} 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 <= (-6.4d+154)) then
tmp = t_1
else if (y <= (-1.36d-198)) then
tmp = z + a
else if (y <= 6d-100) then
tmp = ((t * a) + (z * x)) / (x + t)
else if (y <= 3d-38) then
tmp = z * ((x + y) / (t + (x + y)))
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 <= -6.4e+154) {
tmp = t_1;
} else if (y <= -1.36e-198) {
tmp = z + a;
} else if (y <= 6e-100) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if (y <= 3e-38) {
tmp = z * ((x + y) / (t + (x + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -6.4e+154: tmp = t_1 elif y <= -1.36e-198: tmp = z + a elif y <= 6e-100: tmp = ((t * a) + (z * x)) / (x + t) elif y <= 3e-38: tmp = z * ((x + y) / (t + (x + y))) 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 <= -6.4e+154) tmp = t_1; elseif (y <= -1.36e-198) tmp = Float64(z + a); elseif (y <= 6e-100) tmp = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)); elseif (y <= 3e-38) tmp = Float64(z * Float64(Float64(x + y) / Float64(t + Float64(x + y)))); 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 <= -6.4e+154) tmp = t_1; elseif (y <= -1.36e-198) tmp = z + a; elseif (y <= 6e-100) tmp = ((t * a) + (z * x)) / (x + t); elseif (y <= 3e-38) tmp = z * ((x + y) / (t + (x + y))); 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, -6.4e+154], t$95$1, If[LessEqual[y, -1.36e-198], N[(z + a), $MachinePrecision], If[LessEqual[y, 6e-100], N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-38], N[(z * N[(N[(x + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.36 \cdot 10^{-198}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-100}:\\
\;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-38}:\\
\;\;\;\;z \cdot \frac{x + y}{t + \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.4e154 or 2.99999999999999989e-38 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -6.4e154 < y < -1.36000000000000002e-198Initial program 54.2%
Taylor expanded in y around inf 45.7%
Taylor expanded in b around 0 62.6%
+-commutative62.6%
Simplified62.6%
if -1.36000000000000002e-198 < y < 6.0000000000000001e-100Initial program 74.7%
Taylor expanded in y around 0 59.4%
if 6.0000000000000001e-100 < y < 2.99999999999999989e-38Initial program 71.8%
Taylor expanded in z around inf 38.3%
associate-/l*60.5%
+-commutative60.5%
+-commutative60.5%
Simplified60.5%
Final simplification72.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -7.5e+142)
t_1
(if (<= y -8.4e-117)
(+ z a)
(if (<= y 9.5e-268)
(* a (/ (+ t y) (+ y (+ x t))))
(if (<= y 2.9e-38) (* z (/ (+ x y) (+ t (+ x y)))) 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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= -8.4e-117) {
tmp = z + a;
} else if (y <= 9.5e-268) {
tmp = a * ((t + y) / (y + (x + t)));
} else if (y <= 2.9e-38) {
tmp = z * ((x + y) / (t + (x + y)));
} 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 <= (-7.5d+142)) then
tmp = t_1
else if (y <= (-8.4d-117)) then
tmp = z + a
else if (y <= 9.5d-268) then
tmp = a * ((t + y) / (y + (x + t)))
else if (y <= 2.9d-38) then
tmp = z * ((x + y) / (t + (x + y)))
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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= -8.4e-117) {
tmp = z + a;
} else if (y <= 9.5e-268) {
tmp = a * ((t + y) / (y + (x + t)));
} else if (y <= 2.9e-38) {
tmp = z * ((x + y) / (t + (x + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -7.5e+142: tmp = t_1 elif y <= -8.4e-117: tmp = z + a elif y <= 9.5e-268: tmp = a * ((t + y) / (y + (x + t))) elif y <= 2.9e-38: tmp = z * ((x + y) / (t + (x + y))) 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 <= -7.5e+142) tmp = t_1; elseif (y <= -8.4e-117) tmp = Float64(z + a); elseif (y <= 9.5e-268) tmp = Float64(a * Float64(Float64(t + y) / Float64(y + Float64(x + t)))); elseif (y <= 2.9e-38) tmp = Float64(z * Float64(Float64(x + y) / Float64(t + Float64(x + y)))); 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 <= -7.5e+142) tmp = t_1; elseif (y <= -8.4e-117) tmp = z + a; elseif (y <= 9.5e-268) tmp = a * ((t + y) / (y + (x + t))); elseif (y <= 2.9e-38) tmp = z * ((x + y) / (t + (x + y))); 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, -7.5e+142], t$95$1, If[LessEqual[y, -8.4e-117], N[(z + a), $MachinePrecision], If[LessEqual[y, 9.5e-268], N[(a * N[(N[(t + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-38], N[(z * N[(N[(x + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -8.4 \cdot 10^{-117}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-268}:\\
\;\;\;\;a \cdot \frac{t + y}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-38}:\\
\;\;\;\;z \cdot \frac{x + y}{t + \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5000000000000002e142 or 2.89999999999999994e-38 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -7.5000000000000002e142 < y < -8.3999999999999996e-117Initial program 47.8%
Taylor expanded in y around inf 48.2%
Taylor expanded in b around 0 68.5%
+-commutative68.5%
Simplified68.5%
if -8.3999999999999996e-117 < y < 9.50000000000000007e-268Initial program 77.4%
Taylor expanded in a around inf 51.2%
associate-/l*63.5%
associate-+r+63.5%
Simplified63.5%
if 9.50000000000000007e-268 < y < 2.89999999999999994e-38Initial program 70.6%
Taylor expanded in z around inf 33.7%
associate-/l*50.1%
+-commutative50.1%
+-commutative50.1%
Simplified50.1%
Final simplification72.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.8e+144) (not (<= y 1.3e-64))) (- (+ z a) b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.8e+144) || !(y <= 1.3e-64)) {
tmp = (z + a) - b;
} else {
tmp = z + 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 ((y <= (-2.8d+144)) .or. (.not. (y <= 1.3d-64))) then
tmp = (z + a) - b
else
tmp = z + 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 ((y <= -2.8e+144) || !(y <= 1.3e-64)) {
tmp = (z + a) - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.8e+144) or not (y <= 1.3e-64): tmp = (z + a) - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.8e+144) || !(y <= 1.3e-64)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.8e+144) || ~((y <= 1.3e-64))) tmp = (z + a) - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.8e+144], N[Not[LessEqual[y, 1.3e-64]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+144} \lor \neg \left(y \leq 1.3 \cdot 10^{-64}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -2.80000000000000007e144 or 1.3e-64 < y Initial program 34.5%
Taylor expanded in y around inf 85.1%
if -2.80000000000000007e144 < y < 1.3e-64Initial program 65.4%
Taylor expanded in y around inf 33.3%
Taylor expanded in b around 0 52.5%
+-commutative52.5%
Simplified52.5%
Final simplification67.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.8e-51) z (if (<= z 1.1e-23) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.8e-51) {
tmp = z;
} else if (z <= 1.1e-23) {
tmp = a;
} 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 (z <= (-4.8d-51)) then
tmp = z
else if (z <= 1.1d-23) then
tmp = a
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 (z <= -4.8e-51) {
tmp = z;
} else if (z <= 1.1e-23) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.8e-51: tmp = z elif z <= 1.1e-23: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.8e-51) tmp = z; elseif (z <= 1.1e-23) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.8e-51) tmp = z; elseif (z <= 1.1e-23) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.8e-51], z, If[LessEqual[z, 1.1e-23], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-51}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-23}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -4.8e-51 or 1.1e-23 < z Initial program 46.0%
Taylor expanded in x around inf 52.1%
if -4.8e-51 < z < 1.1e-23Initial program 58.7%
Taylor expanded in t around inf 50.0%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.02e+214) (- a b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.02e+214) {
tmp = a - b;
} else {
tmp = z + 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 (b <= (-1.02d+214)) then
tmp = a - b
else
tmp = z + 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 (b <= -1.02e+214) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.02e+214: tmp = a - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.02e+214) tmp = Float64(a - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.02e+214) tmp = a - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.02e+214], N[(a - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.02 \cdot 10^{+214}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if b < -1.02e214Initial program 30.2%
Taylor expanded in z around 0 30.6%
*-commutative30.6%
Simplified30.6%
Taylor expanded in y around inf 52.2%
if -1.02e214 < b Initial program 53.1%
Taylor expanded in y around inf 57.7%
Taylor expanded in b around 0 62.3%
+-commutative62.3%
Simplified62.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7.4e+168) a (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.4e+168) {
tmp = a;
} else {
tmp = z + 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 <= (-7.4d+168)) then
tmp = a
else
tmp = z + 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 <= -7.4e+168) {
tmp = a;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.4e+168: tmp = a else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.4e+168) tmp = a; else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.4e+168) tmp = a; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.4e+168], a, N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{+168}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if t < -7.40000000000000018e168Initial program 29.4%
Taylor expanded in t around inf 48.6%
if -7.40000000000000018e168 < t Initial program 54.4%
Taylor expanded in y around inf 61.8%
Taylor expanded in b around 0 63.0%
+-commutative63.0%
Simplified63.0%
(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 51.2%
Taylor expanded in t around inf 35.0%
(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 2024132
(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)))