
(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 12 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 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+264))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+264)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+264)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+264): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+264)) 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+264))) 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[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + 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$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+264]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+264}\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)) < -inf.0 or 2.00000000000000009e264 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.7%
Taylor expanded in y around inf 79.4%
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.00000000000000009e264Initial program 99.7%
Final simplification90.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (* a (/ (+ y t) t_1)))
(t_3 (/ y (+ y t)))
(t_4 (* z (+ (/ a z) (- t_3 (* t_3 (/ b z)))))))
(if (<= a -1e+139)
t_2
(if (<= a -2.06e-199)
t_4
(if (<= a 2.5e-63)
(/ (- (* z (+ x y)) (* y b)) t_1)
(if (<= a 9e+199) t_4 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) / t_1);
double t_3 = y / (y + t);
double t_4 = z * ((a / z) + (t_3 - (t_3 * (b / z))));
double tmp;
if (a <= -1e+139) {
tmp = t_2;
} else if (a <= -2.06e-199) {
tmp = t_4;
} else if (a <= 2.5e-63) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (a <= 9e+199) {
tmp = t_4;
} 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = y + (x + t)
t_2 = a * ((y + t) / t_1)
t_3 = y / (y + t)
t_4 = z * ((a / z) + (t_3 - (t_3 * (b / z))))
if (a <= (-1d+139)) then
tmp = t_2
else if (a <= (-2.06d-199)) then
tmp = t_4
else if (a <= 2.5d-63) then
tmp = ((z * (x + y)) - (y * b)) / t_1
else if (a <= 9d+199) then
tmp = t_4
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) / t_1);
double t_3 = y / (y + t);
double t_4 = z * ((a / z) + (t_3 - (t_3 * (b / z))));
double tmp;
if (a <= -1e+139) {
tmp = t_2;
} else if (a <= -2.06e-199) {
tmp = t_4;
} else if (a <= 2.5e-63) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (a <= 9e+199) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a * ((y + t) / t_1) t_3 = y / (y + t) t_4 = z * ((a / z) + (t_3 - (t_3 * (b / z)))) tmp = 0 if a <= -1e+139: tmp = t_2 elif a <= -2.06e-199: tmp = t_4 elif a <= 2.5e-63: tmp = ((z * (x + y)) - (y * b)) / t_1 elif a <= 9e+199: tmp = t_4 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) / t_1)) t_3 = Float64(y / Float64(y + t)) t_4 = Float64(z * Float64(Float64(a / z) + Float64(t_3 - Float64(t_3 * Float64(b / z))))) tmp = 0.0 if (a <= -1e+139) tmp = t_2; elseif (a <= -2.06e-199) tmp = t_4; elseif (a <= 2.5e-63) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / t_1); elseif (a <= 9e+199) tmp = t_4; 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) / t_1); t_3 = y / (y + t); t_4 = z * ((a / z) + (t_3 - (t_3 * (b / z)))); tmp = 0.0; if (a <= -1e+139) tmp = t_2; elseif (a <= -2.06e-199) tmp = t_4; elseif (a <= 2.5e-63) tmp = ((z * (x + y)) - (y * b)) / t_1; elseif (a <= 9e+199) tmp = t_4; 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] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(a / z), $MachinePrecision] + N[(t$95$3 - N[(t$95$3 * N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e+139], t$95$2, If[LessEqual[a, -2.06e-199], t$95$4, If[LessEqual[a, 2.5e-63], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[a, 9e+199], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \frac{y + t}{t\_1}\\
t_3 := \frac{y}{y + t}\\
t_4 := z \cdot \left(\frac{a}{z} + \left(t\_3 - t\_3 \cdot \frac{b}{z}\right)\right)\\
\mathbf{if}\;a \leq -1 \cdot 10^{+139}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -2.06 \cdot 10^{-199}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{t\_1}\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+199}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -1.00000000000000003e139 or 8.9999999999999994e199 < a Initial program 30.7%
Taylor expanded in a around inf 25.7%
associate-/l*85.4%
associate-+r+85.4%
Simplified85.4%
if -1.00000000000000003e139 < a < -2.06000000000000004e-199 or 2.5000000000000001e-63 < a < 8.9999999999999994e199Initial program 63.5%
Taylor expanded in z around inf 67.9%
Taylor expanded in x around 0 55.4%
associate--l+55.4%
+-commutative55.4%
times-frac65.1%
+-commutative65.1%
Simplified65.1%
if -2.06000000000000004e-199 < a < 2.5000000000000001e-63Initial program 76.1%
Taylor expanded in a around 0 69.4%
+-commutative69.4%
*-commutative69.4%
Simplified69.4%
Final simplification71.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.7e-5)
t_1
(if (<= y 2e-82)
(/ (+ (* t a) (* x z)) (+ x t))
(if (or (<= y 2.3e-48) (and (not (<= y 3100000000.0)) (<= y 8.6e+33)))
(/ (* y t_1) (+ 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 <= -1.7e-5) {
tmp = t_1;
} else if (y <= 2e-82) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if ((y <= 2.3e-48) || (!(y <= 3100000000.0) && (y <= 8.6e+33))) {
tmp = (y * t_1) / (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 <= (-1.7d-5)) then
tmp = t_1
else if (y <= 2d-82) then
tmp = ((t * a) + (x * z)) / (x + t)
else if ((y <= 2.3d-48) .or. (.not. (y <= 3100000000.0d0)) .and. (y <= 8.6d+33)) then
tmp = (y * t_1) / (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 <= -1.7e-5) {
tmp = t_1;
} else if (y <= 2e-82) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if ((y <= 2.3e-48) || (!(y <= 3100000000.0) && (y <= 8.6e+33))) {
tmp = (y * t_1) / (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 <= -1.7e-5: tmp = t_1 elif y <= 2e-82: tmp = ((t * a) + (x * z)) / (x + t) elif (y <= 2.3e-48) or (not (y <= 3100000000.0) and (y <= 8.6e+33)): tmp = (y * t_1) / (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 <= -1.7e-5) tmp = t_1; elseif (y <= 2e-82) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif ((y <= 2.3e-48) || (!(y <= 3100000000.0) && (y <= 8.6e+33))) tmp = Float64(Float64(y * t_1) / 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 <= -1.7e-5) tmp = t_1; elseif (y <= 2e-82) tmp = ((t * a) + (x * z)) / (x + t); elseif ((y <= 2.3e-48) || (~((y <= 3100000000.0)) && (y <= 8.6e+33))) tmp = (y * t_1) / (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, -1.7e-5], t$95$1, If[LessEqual[y, 2e-82], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 2.3e-48], And[N[Not[LessEqual[y, 3100000000.0]], $MachinePrecision], LessEqual[y, 8.6e+33]]], N[(N[(y * t$95$1), $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 -1.7 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-82}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-48} \lor \neg \left(y \leq 3100000000\right) \land y \leq 8.6 \cdot 10^{+33}:\\
\;\;\;\;\frac{y \cdot t\_1}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.7e-5 or 2.3000000000000001e-48 < y < 3.1e9 or 8.60000000000000057e33 < y Initial program 42.3%
Taylor expanded in y around inf 77.3%
if -1.7e-5 < y < 2e-82Initial program 73.6%
Taylor expanded in y around 0 63.9%
if 2e-82 < y < 2.3000000000000001e-48 or 3.1e9 < y < 8.60000000000000057e33Initial program 88.1%
Taylor expanded in y around inf 72.0%
Final simplification71.2%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= t -8.4e+185)
(not (or (<= t -3.7e+51) (and (not (<= t -95.0)) (<= t 1.45e+196)))))
(* a (/ (+ y t) (+ y (+ x t))))
(- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.4e+185) || !((t <= -3.7e+51) || (!(t <= -95.0) && (t <= 1.45e+196)))) {
tmp = a * ((y + t) / (y + (x + t)));
} 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 ((t <= (-8.4d+185)) .or. (.not. (t <= (-3.7d+51)) .or. (.not. (t <= (-95.0d0))) .and. (t <= 1.45d+196))) then
tmp = a * ((y + t) / (y + (x + t)))
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 ((t <= -8.4e+185) || !((t <= -3.7e+51) || (!(t <= -95.0) && (t <= 1.45e+196)))) {
tmp = a * ((y + t) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.4e+185) or not ((t <= -3.7e+51) or (not (t <= -95.0) and (t <= 1.45e+196))): tmp = a * ((y + t) / (y + (x + t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.4e+185) || !((t <= -3.7e+51) || (!(t <= -95.0) && (t <= 1.45e+196)))) tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); 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 ((t <= -8.4e+185) || ~(((t <= -3.7e+51) || (~((t <= -95.0)) && (t <= 1.45e+196))))) tmp = a * ((y + t) / (y + (x + t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.4e+185], N[Not[Or[LessEqual[t, -3.7e+51], And[N[Not[LessEqual[t, -95.0]], $MachinePrecision], LessEqual[t, 1.45e+196]]]], $MachinePrecision]], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{+185} \lor \neg \left(t \leq -3.7 \cdot 10^{+51} \lor \neg \left(t \leq -95\right) \land t \leq 1.45 \cdot 10^{+196}\right):\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -8.4e185 or -3.7000000000000002e51 < t < -95 or 1.45e196 < t Initial program 44.4%
Taylor expanded in a around inf 33.2%
associate-/l*70.3%
associate-+r+70.3%
Simplified70.3%
if -8.4e185 < t < -3.7000000000000002e51 or -95 < t < 1.45e196Initial program 63.9%
Taylor expanded in y around inf 66.7%
Final simplification67.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.9e-5)
t_1
(if (<= y 1.36e-90)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 2.4e-48)
(/ (- (* z (+ x y)) (* y b)) (+ y (+ x t)))
(if (<= y 7.6e-38) (+ z (* a (/ (+ y t) x))) 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 <= -2.9e-5) {
tmp = t_1;
} else if (y <= 1.36e-90) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.4e-48) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else if (y <= 7.6e-38) {
tmp = z + (a * ((y + t) / x));
} 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 <= (-2.9d-5)) then
tmp = t_1
else if (y <= 1.36d-90) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 2.4d-48) then
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t))
else if (y <= 7.6d-38) then
tmp = z + (a * ((y + t) / x))
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 <= -2.9e-5) {
tmp = t_1;
} else if (y <= 1.36e-90) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.4e-48) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else if (y <= 7.6e-38) {
tmp = z + (a * ((y + t) / x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.9e-5: tmp = t_1 elif y <= 1.36e-90: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 2.4e-48: tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)) elif y <= 7.6e-38: tmp = z + (a * ((y + t) / x)) 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 <= -2.9e-5) tmp = t_1; elseif (y <= 1.36e-90) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 2.4e-48) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (y <= 7.6e-38) tmp = Float64(z + Float64(a * Float64(Float64(y + t) / x))); 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 <= -2.9e-5) tmp = t_1; elseif (y <= 1.36e-90) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 2.4e-48) tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)); elseif (y <= 7.6e-38) tmp = z + (a * ((y + t) / x)); 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, -2.9e-5], t$95$1, If[LessEqual[y, 1.36e-90], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-48], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e-38], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{-90}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-48}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-38}:\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.9e-5 or 7.5999999999999999e-38 < y Initial program 43.9%
Taylor expanded in y around inf 76.6%
if -2.9e-5 < y < 1.36000000000000011e-90Initial program 73.4%
Taylor expanded in y around 0 63.5%
if 1.36000000000000011e-90 < y < 2.4e-48Initial program 81.2%
Taylor expanded in a around 0 81.2%
+-commutative81.2%
*-commutative81.2%
Simplified81.2%
if 2.4e-48 < y < 7.5999999999999999e-38Initial program 80.8%
Taylor expanded in x around inf 61.1%
associate--l+61.1%
associate-/l*61.1%
associate-/l*61.1%
associate-/l*61.1%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in a around -inf 81.7%
associate-*r/81.7%
+-commutative81.7%
Simplified81.7%
Final simplification71.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (/ (+ y t) (+ y (+ x t))))))
(if (<= a -4.5e+155)
t_1
(if (<= a -4.2e-187)
(- (+ z a) b)
(if (<= a 8e+138) (/ z (/ (+ t (+ x y)) (+ x y))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * ((y + t) / (y + (x + t)));
double tmp;
if (a <= -4.5e+155) {
tmp = t_1;
} else if (a <= -4.2e-187) {
tmp = (z + a) - b;
} else if (a <= 8e+138) {
tmp = z / ((t + (x + y)) / (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 = a * ((y + t) / (y + (x + t)))
if (a <= (-4.5d+155)) then
tmp = t_1
else if (a <= (-4.2d-187)) then
tmp = (z + a) - b
else if (a <= 8d+138) then
tmp = z / ((t + (x + y)) / (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 = a * ((y + t) / (y + (x + t)));
double tmp;
if (a <= -4.5e+155) {
tmp = t_1;
} else if (a <= -4.2e-187) {
tmp = (z + a) - b;
} else if (a <= 8e+138) {
tmp = z / ((t + (x + y)) / (x + y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * ((y + t) / (y + (x + t))) tmp = 0 if a <= -4.5e+155: tmp = t_1 elif a <= -4.2e-187: tmp = (z + a) - b elif a <= 8e+138: tmp = z / ((t + (x + y)) / (x + y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))) tmp = 0.0 if (a <= -4.5e+155) tmp = t_1; elseif (a <= -4.2e-187) tmp = Float64(Float64(z + a) - b); elseif (a <= 8e+138) tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * ((y + t) / (y + (x + t))); tmp = 0.0; if (a <= -4.5e+155) tmp = t_1; elseif (a <= -4.2e-187) tmp = (z + a) - b; elseif (a <= 8e+138) tmp = z / ((t + (x + y)) / (x + y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.5e+155], t$95$1, If[LessEqual[a, -4.2e-187], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[a, 8e+138], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-187}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+138}:\\
\;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.49999999999999973e155 or 8.0000000000000003e138 < a Initial program 32.6%
Taylor expanded in a around inf 25.2%
associate-/l*79.9%
associate-+r+79.9%
Simplified79.9%
if -4.49999999999999973e155 < a < -4.19999999999999985e-187Initial program 60.4%
Taylor expanded in y around inf 64.9%
if -4.19999999999999985e-187 < a < 8.0000000000000003e138Initial program 74.7%
Taylor expanded in a around 0 60.4%
+-commutative60.4%
*-commutative60.4%
Simplified60.4%
Taylor expanded in z around inf 41.2%
associate-/l*60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
Simplified60.2%
clear-num60.2%
un-div-inv60.3%
+-commutative60.3%
Applied egg-rr60.3%
Final simplification67.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (* a (/ (+ y t) t_1))))
(if (<= a -1.02e+153)
t_2
(if (<= a -1.05e-186)
(- (+ z a) b)
(if (<= a 5.8e+138) (* z (/ (+ x y) 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) / t_1);
double tmp;
if (a <= -1.02e+153) {
tmp = t_2;
} else if (a <= -1.05e-186) {
tmp = (z + a) - b;
} else if (a <= 5.8e+138) {
tmp = z * ((x + y) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = a * ((y + t) / t_1)
if (a <= (-1.02d+153)) then
tmp = t_2
else if (a <= (-1.05d-186)) then
tmp = (z + a) - b
else if (a <= 5.8d+138) then
tmp = z * ((x + y) / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -1.02e+153) {
tmp = t_2;
} else if (a <= -1.05e-186) {
tmp = (z + a) - b;
} else if (a <= 5.8e+138) {
tmp = z * ((x + y) / 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) / t_1) tmp = 0 if a <= -1.02e+153: tmp = t_2 elif a <= -1.05e-186: tmp = (z + a) - b elif a <= 5.8e+138: tmp = z * ((x + y) / 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) / t_1)) tmp = 0.0 if (a <= -1.02e+153) tmp = t_2; elseif (a <= -1.05e-186) tmp = Float64(Float64(z + a) - b); elseif (a <= 5.8e+138) tmp = Float64(z * Float64(Float64(x + y) / 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) / t_1); tmp = 0.0; if (a <= -1.02e+153) tmp = t_2; elseif (a <= -1.05e-186) tmp = (z + a) - b; elseif (a <= 5.8e+138) tmp = z * ((x + y) / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.02e+153], t$95$2, If[LessEqual[a, -1.05e-186], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[a, 5.8e+138], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \frac{y + t}{t\_1}\\
\mathbf{if}\;a \leq -1.02 \cdot 10^{+153}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.05 \cdot 10^{-186}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+138}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -1.0199999999999999e153 or 5.80000000000000019e138 < a Initial program 32.6%
Taylor expanded in a around inf 25.2%
associate-/l*79.9%
associate-+r+79.9%
Simplified79.9%
if -1.0199999999999999e153 < a < -1.0500000000000001e-186Initial program 60.4%
Taylor expanded in y around inf 64.9%
if -1.0500000000000001e-186 < a < 5.80000000000000019e138Initial program 74.7%
Taylor expanded in z around inf 41.2%
associate-/l*60.2%
+-commutative60.2%
associate-+r+60.2%
Simplified60.2%
Final simplification67.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.6e-5) (not (<= y 2.4e-85))) (- (+ 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 <= -5.6e-5) || !(y <= 2.4e-85)) {
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 <= (-5.6d-5)) .or. (.not. (y <= 2.4d-85))) 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 <= -5.6e-5) || !(y <= 2.4e-85)) {
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 <= -5.6e-5) or not (y <= 2.4e-85): 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 <= -5.6e-5) || !(y <= 2.4e-85)) 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 <= -5.6e-5) || ~((y <= 2.4e-85))) 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, -5.6e-5], N[Not[LessEqual[y, 2.4e-85]], $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 -5.6 \cdot 10^{-5} \lor \neg \left(y \leq 2.4 \cdot 10^{-85}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\end{array}
\end{array}
if y < -5.59999999999999992e-5 or 2.4000000000000001e-85 < y Initial program 47.3%
Taylor expanded in y around inf 73.9%
if -5.59999999999999992e-5 < y < 2.4000000000000001e-85Initial program 73.6%
Taylor expanded in y around 0 63.9%
Final simplification69.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6.4e+39) a (if (<= a 1.04e-221) (- z b) (if (<= a 2.7e+208) z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.4e+39) {
tmp = a;
} else if (a <= 1.04e-221) {
tmp = z - b;
} else if (a <= 2.7e+208) {
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 <= (-6.4d+39)) then
tmp = a
else if (a <= 1.04d-221) then
tmp = z - b
else if (a <= 2.7d+208) 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 <= -6.4e+39) {
tmp = a;
} else if (a <= 1.04e-221) {
tmp = z - b;
} else if (a <= 2.7e+208) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.4e+39: tmp = a elif a <= 1.04e-221: tmp = z - b elif a <= 2.7e+208: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.4e+39) tmp = a; elseif (a <= 1.04e-221) tmp = Float64(z - b); elseif (a <= 2.7e+208) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.4e+39) tmp = a; elseif (a <= 1.04e-221) tmp = z - b; elseif (a <= 2.7e+208) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.4e+39], a, If[LessEqual[a, 1.04e-221], N[(z - b), $MachinePrecision], If[LessEqual[a, 2.7e+208], z, a]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{+39}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.04 \cdot 10^{-221}:\\
\;\;\;\;z - b\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+208}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -6.39999999999999986e39 or 2.7e208 < a Initial program 31.6%
Taylor expanded in t around inf 71.6%
if -6.39999999999999986e39 < a < 1.0399999999999999e-221Initial program 67.3%
Taylor expanded in a around 0 48.5%
+-commutative48.5%
*-commutative48.5%
Simplified48.5%
Taylor expanded in y around inf 53.5%
if 1.0399999999999999e-221 < a < 2.7e208Initial program 77.1%
Taylor expanded in x around inf 46.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.9e+187) a (if (<= t 7.4e+196) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.9e+187) {
tmp = a;
} else if (t <= 7.4e+196) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.9d+187)) then
tmp = a
else if (t <= 7.4d+196) then
tmp = (z + a) - b
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.9e+187) {
tmp = a;
} else if (t <= 7.4e+196) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.9e+187: tmp = a elif t <= 7.4e+196: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.9e+187) tmp = a; elseif (t <= 7.4e+196) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.9e+187) tmp = a; elseif (t <= 7.4e+196) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.9e+187], a, If[LessEqual[t, 7.4e+196], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+187}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{+196}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -2.9000000000000001e187 or 7.3999999999999998e196 < t Initial program 36.8%
Taylor expanded in t around inf 68.7%
if -2.9000000000000001e187 < t < 7.3999999999999998e196Initial program 64.4%
Taylor expanded in y around inf 63.8%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -8.8e-25) a (if (<= a 1.75e+209) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.8e-25) {
tmp = a;
} else if (a <= 1.75e+209) {
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 <= (-8.8d-25)) then
tmp = a
else if (a <= 1.75d+209) 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 <= -8.8e-25) {
tmp = a;
} else if (a <= 1.75e+209) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8.8e-25: tmp = a elif a <= 1.75e+209: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8.8e-25) tmp = a; elseif (a <= 1.75e+209) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -8.8e-25) tmp = a; elseif (a <= 1.75e+209) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8.8e-25], a, If[LessEqual[a, 1.75e+209], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.8 \cdot 10^{-25}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{+209}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -8.8000000000000008e-25 or 1.7500000000000001e209 < a Initial program 38.8%
Taylor expanded in t around inf 65.0%
if -8.8000000000000008e-25 < a < 1.7500000000000001e209Initial program 71.9%
Taylor expanded in x around inf 44.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 58.6%
Taylor expanded in t around inf 37.5%
(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 2024089
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))