
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x))
(t_2 (+ (* a (/ (+ y t) t_1)) (* z (/ (+ y x) t_1)))))
(if (or (<= b -2.9e+43) (not (<= b 1e-9)))
(* (- b) (fma -1.0 (/ t_2 b) (/ y t_1)))
(fma -1.0 (/ (* b y) t_1) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = (a * ((y + t) / t_1)) + (z * ((y + x) / t_1));
double tmp;
if ((b <= -2.9e+43) || !(b <= 1e-9)) {
tmp = -b * fma(-1.0, (t_2 / b), (y / t_1));
} else {
tmp = fma(-1.0, ((b * y) / t_1), t_2);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(Float64(a * Float64(Float64(y + t) / t_1)) + Float64(z * Float64(Float64(y + x) / t_1))) tmp = 0.0 if ((b <= -2.9e+43) || !(b <= 1e-9)) tmp = Float64(Float64(-b) * fma(-1.0, Float64(t_2 / b), Float64(y / t_1))); else tmp = fma(-1.0, Float64(Float64(b * y) / t_1), t_2); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -2.9e+43], N[Not[LessEqual[b, 1e-9]], $MachinePrecision]], N[((-b) * N[(-1.0 * N[(t$95$2 / b), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(b * y), $MachinePrecision] / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := a \cdot \frac{y + t}{t\_1} + z \cdot \frac{y + x}{t\_1}\\
\mathbf{if}\;b \leq -2.9 \cdot 10^{+43} \lor \neg \left(b \leq 10^{-9}\right):\\
\;\;\;\;\left(-b\right) \cdot \mathsf{fma}\left(-1, \frac{t\_2}{b}, \frac{y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b \cdot y}{t\_1}, t\_2\right)\\
\end{array}
\end{array}
if b < -2.9000000000000002e43 or 1.00000000000000006e-9 < b Initial program 49.4%
Taylor expanded in b around -inf 56.2%
associate-*r*56.2%
neg-mul-156.2%
fma-define56.2%
Simplified97.4%
if -2.9000000000000002e43 < b < 1.00000000000000006e-9Initial program 62.4%
Taylor expanded in b around 0 62.5%
fma-define62.5%
*-commutative62.5%
+-commutative62.5%
associate-+r+62.5%
associate-/l*80.7%
+-commutative80.7%
+-commutative80.7%
associate-+r+80.7%
associate-/l*98.9%
+-commutative98.9%
+-commutative98.9%
associate-+r+98.9%
Simplified98.9%
Final simplification98.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x)) (t_2 (/ (+ y t) t_1)) (t_3 (/ y t_1)))
(if (<= b -5.6e+114)
(* b (- (+ (/ a b) (/ z b)) t_3))
(if (<= b 3.1e+137)
(fma -1.0 (/ (* b y) t_1) (+ (* a t_2) (* z (/ (+ y x) t_1))))
(* b (- (fma z (/ (+ y x) (* b t_1)) (* t_2 (/ a b))) t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = (y + t) / t_1;
double t_3 = y / t_1;
double tmp;
if (b <= -5.6e+114) {
tmp = b * (((a / b) + (z / b)) - t_3);
} else if (b <= 3.1e+137) {
tmp = fma(-1.0, ((b * y) / t_1), ((a * t_2) + (z * ((y + x) / t_1))));
} else {
tmp = b * (fma(z, ((y + x) / (b * t_1)), (t_2 * (a / b))) - t_3);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(Float64(y + t) / t_1) t_3 = Float64(y / t_1) tmp = 0.0 if (b <= -5.6e+114) tmp = Float64(b * Float64(Float64(Float64(a / b) + Float64(z / b)) - t_3)); elseif (b <= 3.1e+137) tmp = fma(-1.0, Float64(Float64(b * y) / t_1), Float64(Float64(a * t_2) + Float64(z * Float64(Float64(y + x) / t_1)))); else tmp = Float64(b * Float64(fma(z, Float64(Float64(y + x) / Float64(b * t_1)), Float64(t_2 * Float64(a / b))) - t_3)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$1), $MachinePrecision]}, If[LessEqual[b, -5.6e+114], N[(b * N[(N[(N[(a / b), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e+137], N[(-1.0 * N[(N[(b * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(a * t$95$2), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(z * N[(N[(y + x), $MachinePrecision] / N[(b * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := \frac{y + t}{t\_1}\\
t_3 := \frac{y}{t\_1}\\
\mathbf{if}\;b \leq -5.6 \cdot 10^{+114}:\\
\;\;\;\;b \cdot \left(\left(\frac{a}{b} + \frac{z}{b}\right) - t\_3\right)\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b \cdot y}{t\_1}, a \cdot t\_2 + z \cdot \frac{y + x}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\mathsf{fma}\left(z, \frac{y + x}{b \cdot t\_1}, t\_2 \cdot \frac{a}{b}\right) - t\_3\right)\\
\end{array}
\end{array}
if b < -5.6000000000000001e114Initial program 34.0%
Taylor expanded in b around inf 24.6%
+-commutative24.6%
mul-1-neg24.6%
unsub-neg24.6%
Simplified69.0%
Taylor expanded in y around inf 83.6%
if -5.6000000000000001e114 < b < 3.0999999999999999e137Initial program 63.8%
Taylor expanded in b around 0 63.8%
fma-define63.8%
*-commutative63.8%
+-commutative63.8%
associate-+r+63.8%
associate-/l*79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
associate-/l*96.5%
+-commutative96.5%
+-commutative96.5%
associate-+r+96.5%
Simplified96.5%
if 3.0999999999999999e137 < b Initial program 40.5%
Taylor expanded in b around inf 50.1%
+-commutative50.1%
mul-1-neg50.1%
unsub-neg50.1%
Simplified94.2%
Final simplification94.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x)))
(if (or (<= b -1.2e+115) (not (<= b 3.1e+159)))
(* b (- (+ (/ a b) (/ z b)) (/ y t_1)))
(fma
-1.0
(/ (* b y) t_1)
(+ (* a (/ (+ y t) t_1)) (* z (/ (+ y x) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double tmp;
if ((b <= -1.2e+115) || !(b <= 3.1e+159)) {
tmp = b * (((a / b) + (z / b)) - (y / t_1));
} else {
tmp = fma(-1.0, ((b * y) / t_1), ((a * ((y + t) / t_1)) + (z * ((y + x) / t_1))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) tmp = 0.0 if ((b <= -1.2e+115) || !(b <= 3.1e+159)) tmp = Float64(b * Float64(Float64(Float64(a / b) + Float64(z / b)) - Float64(y / t_1))); else tmp = fma(-1.0, Float64(Float64(b * y) / t_1), Float64(Float64(a * Float64(Float64(y + t) / t_1)) + Float64(z * Float64(Float64(y + x) / t_1)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, If[Or[LessEqual[b, -1.2e+115], N[Not[LessEqual[b, 3.1e+159]], $MachinePrecision]], N[(b * N[(N[(N[(a / b), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(b * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+115} \lor \neg \left(b \leq 3.1 \cdot 10^{+159}\right):\\
\;\;\;\;b \cdot \left(\left(\frac{a}{b} + \frac{z}{b}\right) - \frac{y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b \cdot y}{t\_1}, a \cdot \frac{y + t}{t\_1} + z \cdot \frac{y + x}{t\_1}\right)\\
\end{array}
\end{array}
if b < -1.2e115 or 3.0999999999999998e159 < b Initial program 33.3%
Taylor expanded in b around inf 34.8%
+-commutative34.8%
mul-1-neg34.8%
unsub-neg34.8%
Simplified80.6%
Taylor expanded in y around inf 84.4%
if -1.2e115 < b < 3.0999999999999998e159Initial program 64.0%
Taylor expanded in b around 0 64.0%
fma-define64.0%
*-commutative64.0%
+-commutative64.0%
associate-+r+64.0%
associate-/l*79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
associate-/l*96.2%
+-commutative96.2%
+-commutative96.2%
associate-+r+96.2%
Simplified96.2%
Final simplification93.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* b y)) (+ y (+ t x))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+222))) (- (+ a z) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+222)) {
tmp = (a + z) - 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 = (((z * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+222)) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+222): tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(b * y)) / Float64(y + Float64(t + x))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+222)) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+222))) tmp = (a + z) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+222]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+222}\right):\\
\;\;\;\;\left(a + z\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.0000000000000001e222 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.7%
Taylor expanded in y around inf 72.7%
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.0000000000000001e222Initial program 99.7%
Final simplification87.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.5e+25) (not (<= b 3.8e-63))) (* b (- (+ (/ a b) (/ z b)) (/ y (+ (+ y t) x)))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.5e+25) || !(b <= 3.8e-63)) {
tmp = b * (((a / b) + (z / b)) - (y / ((y + t) + x)));
} else {
tmp = (a + z) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-6.5d+25)) .or. (.not. (b <= 3.8d-63))) then
tmp = b * (((a / b) + (z / b)) - (y / ((y + t) + x)))
else
tmp = (a + z) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.5e+25) || !(b <= 3.8e-63)) {
tmp = b * (((a / b) + (z / b)) - (y / ((y + t) + x)));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.5e+25) or not (b <= 3.8e-63): tmp = b * (((a / b) + (z / b)) - (y / ((y + t) + x))) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.5e+25) || !(b <= 3.8e-63)) tmp = Float64(b * Float64(Float64(Float64(a / b) + Float64(z / b)) - Float64(y / Float64(Float64(y + t) + x)))); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -6.5e+25) || ~((b <= 3.8e-63))) tmp = b * (((a / b) + (z / b)) - (y / ((y + t) + x))); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -6.5e+25], N[Not[LessEqual[b, 3.8e-63]], $MachinePrecision]], N[(b * N[(N[(N[(a / b), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{+25} \lor \neg \left(b \leq 3.8 \cdot 10^{-63}\right):\\
\;\;\;\;b \cdot \left(\left(\frac{a}{b} + \frac{z}{b}\right) - \frac{y}{\left(y + t\right) + x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if b < -6.50000000000000005e25 or 3.80000000000000017e-63 < b Initial program 53.7%
Taylor expanded in b around inf 51.2%
+-commutative51.2%
mul-1-neg51.2%
unsub-neg51.2%
Simplified85.9%
Taylor expanded in y around inf 77.1%
if -6.50000000000000005e25 < b < 3.80000000000000017e-63Initial program 59.6%
Taylor expanded in y around inf 66.4%
Final simplification72.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.2e-69) (not (<= y 1.1e-145))) (- (+ a z) b) (* a (+ (/ t (+ t x)) (/ (* x z) (* a (+ t x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.2e-69) || !(y <= 1.1e-145)) {
tmp = (a + z) - b;
} else {
tmp = a * ((t / (t + x)) + ((x * z) / (a * (t + x))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-3.2d-69)) .or. (.not. (y <= 1.1d-145))) then
tmp = (a + z) - b
else
tmp = a * ((t / (t + x)) + ((x * z) / (a * (t + x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.2e-69) || !(y <= 1.1e-145)) {
tmp = (a + z) - b;
} else {
tmp = a * ((t / (t + x)) + ((x * z) / (a * (t + x))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.2e-69) or not (y <= 1.1e-145): tmp = (a + z) - b else: tmp = a * ((t / (t + x)) + ((x * z) / (a * (t + x)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.2e-69) || !(y <= 1.1e-145)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a * Float64(Float64(t / Float64(t + x)) + Float64(Float64(x * z) / Float64(a * Float64(t + x))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.2e-69) || ~((y <= 1.1e-145))) tmp = (a + z) - b; else tmp = a * ((t / (t + x)) + ((x * z) / (a * (t + x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.2e-69], N[Not[LessEqual[y, 1.1e-145]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / N[(a * N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-69} \lor \neg \left(y \leq 1.1 \cdot 10^{-145}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t + x} + \frac{x \cdot z}{a \cdot \left(t + x\right)}\right)\\
\end{array}
\end{array}
if y < -3.19999999999999999e-69 or 1.1e-145 < y Initial program 48.4%
Taylor expanded in y around inf 69.9%
if -3.19999999999999999e-69 < y < 1.1e-145Initial program 75.8%
Taylor expanded in b around 0 75.8%
fma-define75.8%
*-commutative75.8%
+-commutative75.8%
associate-+r+75.8%
associate-/l*90.5%
+-commutative90.5%
+-commutative90.5%
associate-+r+90.5%
associate-/l*98.0%
+-commutative98.0%
+-commutative98.0%
associate-+r+98.0%
Simplified98.0%
Taylor expanded in a around inf 77.2%
fma-define77.2%
times-frac71.0%
times-frac79.0%
Simplified79.0%
Taylor expanded in y around 0 66.2%
Final simplification68.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -7.6e+38)
t_1
(if (<= y -4.9e-227)
(/ (- (* a (+ y t)) (* b y)) (+ y (+ t x)))
(if (<= y 9.2e-166) (/ (+ (* x z) (* a t)) (+ t x)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -7.6e+38) {
tmp = t_1;
} else if (y <= -4.9e-227) {
tmp = ((a * (y + t)) - (b * y)) / (y + (t + x));
} else if (y <= 9.2e-166) {
tmp = ((x * z) + (a * t)) / (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 = (a + z) - b
if (y <= (-7.6d+38)) then
tmp = t_1
else if (y <= (-4.9d-227)) then
tmp = ((a * (y + t)) - (b * y)) / (y + (t + x))
else if (y <= 9.2d-166) then
tmp = ((x * z) + (a * t)) / (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 = (a + z) - b;
double tmp;
if (y <= -7.6e+38) {
tmp = t_1;
} else if (y <= -4.9e-227) {
tmp = ((a * (y + t)) - (b * y)) / (y + (t + x));
} else if (y <= 9.2e-166) {
tmp = ((x * z) + (a * t)) / (t + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -7.6e+38: tmp = t_1 elif y <= -4.9e-227: tmp = ((a * (y + t)) - (b * y)) / (y + (t + x)) elif y <= 9.2e-166: tmp = ((x * z) + (a * t)) / (t + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -7.6e+38) tmp = t_1; elseif (y <= -4.9e-227) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(b * y)) / Float64(y + Float64(t + x))); elseif (y <= 9.2e-166) tmp = Float64(Float64(Float64(x * z) + Float64(a * t)) / Float64(t + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -7.6e+38) tmp = t_1; elseif (y <= -4.9e-227) tmp = ((a * (y + t)) - (b * y)) / (y + (t + x)); elseif (y <= 9.2e-166) tmp = ((x * z) + (a * t)) / (t + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -7.6e+38], t$95$1, If[LessEqual[y, -4.9e-227], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-166], N[(N[(N[(x * z), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -7.6 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.9 \cdot 10^{-227}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{x \cdot z + a \cdot t}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5999999999999996e38 or 9.19999999999999995e-166 < y Initial program 43.8%
Taylor expanded in y around inf 71.4%
if -7.5999999999999996e38 < y < -4.9000000000000002e-227Initial program 77.5%
Taylor expanded in z around 0 58.4%
+-commutative58.4%
*-commutative58.4%
Simplified58.4%
if -4.9000000000000002e-227 < y < 9.19999999999999995e-166Initial program 78.4%
Taylor expanded in y around 0 78.4%
Final simplification70.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.3e-105) (not (<= y 2.8e-153))) (- (+ a z) b) (/ (+ (* x z) (* a t)) (+ t x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e-105) || !(y <= 2.8e-153)) {
tmp = (a + z) - b;
} else {
tmp = ((x * z) + (a * t)) / (t + x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.3d-105)) .or. (.not. (y <= 2.8d-153))) then
tmp = (a + z) - b
else
tmp = ((x * z) + (a * t)) / (t + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e-105) || !(y <= 2.8e-153)) {
tmp = (a + z) - b;
} else {
tmp = ((x * z) + (a * t)) / (t + x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.3e-105) or not (y <= 2.8e-153): tmp = (a + z) - b else: tmp = ((x * z) + (a * t)) / (t + x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.3e-105) || !(y <= 2.8e-153)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(Float64(x * z) + Float64(a * t)) / Float64(t + x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.3e-105) || ~((y <= 2.8e-153))) tmp = (a + z) - b; else tmp = ((x * z) + (a * t)) / (t + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.3e-105], N[Not[LessEqual[y, 2.8e-153]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(x * z), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-105} \lor \neg \left(y \leq 2.8 \cdot 10^{-153}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot z + a \cdot t}{t + x}\\
\end{array}
\end{array}
if y < -1.2999999999999999e-105 or 2.8000000000000001e-153 < y Initial program 48.9%
Taylor expanded in y around inf 68.4%
if -1.2999999999999999e-105 < y < 2.8000000000000001e-153Initial program 79.1%
Taylor expanded in y around 0 67.2%
Final simplification68.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.6e+146) (not (<= t 2.8e+156))) (+ a (* y (/ (- z b) t))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.6e+146) || !(t <= 2.8e+156)) {
tmp = a + (y * ((z - b) / t));
} else {
tmp = (a + z) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.6d+146)) .or. (.not. (t <= 2.8d+156))) then
tmp = a + (y * ((z - b) / t))
else
tmp = (a + z) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.6e+146) || !(t <= 2.8e+156)) {
tmp = a + (y * ((z - b) / t));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.6e+146) or not (t <= 2.8e+156): tmp = a + (y * ((z - b) / t)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.6e+146) || !(t <= 2.8e+156)) tmp = Float64(a + Float64(y * Float64(Float64(z - b) / t))); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.6e+146) || ~((t <= 2.8e+156))) tmp = a + (y * ((z - b) / t)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.6e+146], N[Not[LessEqual[t, 2.8e+156]], $MachinePrecision]], N[(a + N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+146} \lor \neg \left(t \leq 2.8 \cdot 10^{+156}\right):\\
\;\;\;\;a + y \cdot \frac{z - b}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -3.5999999999999998e146 or 2.79999999999999988e156 < t Initial program 47.7%
Taylor expanded in x around 0 38.3%
Taylor expanded in y around 0 75.9%
Taylor expanded in t around 0 75.9%
if -3.5999999999999998e146 < t < 2.79999999999999988e156Initial program 59.3%
Taylor expanded in y around inf 64.1%
Final simplification66.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.4e+145) (not (<= t 3.9e+156))) (+ a (* y (/ z t))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.4e+145) || !(t <= 3.9e+156)) {
tmp = a + (y * (z / t));
} else {
tmp = (a + z) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.4d+145)) .or. (.not. (t <= 3.9d+156))) then
tmp = a + (y * (z / t))
else
tmp = (a + z) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.4e+145) || !(t <= 3.9e+156)) {
tmp = a + (y * (z / t));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.4e+145) or not (t <= 3.9e+156): tmp = a + (y * (z / t)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.4e+145) || !(t <= 3.9e+156)) tmp = Float64(a + Float64(y * Float64(z / t))); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.4e+145) || ~((t <= 3.9e+156))) tmp = a + (y * (z / t)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.4e+145], N[Not[LessEqual[t, 3.9e+156]], $MachinePrecision]], N[(a + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+145} \lor \neg \left(t \leq 3.9 \cdot 10^{+156}\right):\\
\;\;\;\;a + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -1.3999999999999999e145 or 3.8999999999999997e156 < t Initial program 47.7%
Taylor expanded in x around 0 38.3%
Taylor expanded in y around 0 75.9%
Taylor expanded in b around 0 61.9%
associate-/l*69.7%
Simplified69.7%
if -1.3999999999999999e145 < t < 3.8999999999999997e156Initial program 59.3%
Taylor expanded in y around inf 64.1%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.05e-110) (not (<= y 2.5e-147))) (- (+ a z) b) (* z (/ x (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e-110) || !(y <= 2.5e-147)) {
tmp = (a + z) - b;
} else {
tmp = z * (x / (t + x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.05d-110)) .or. (.not. (y <= 2.5d-147))) then
tmp = (a + z) - b
else
tmp = z * (x / (t + x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e-110) || !(y <= 2.5e-147)) {
tmp = (a + z) - b;
} else {
tmp = z * (x / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.05e-110) or not (y <= 2.5e-147): tmp = (a + z) - b else: tmp = z * (x / (t + x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.05e-110) || !(y <= 2.5e-147)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z * Float64(x / Float64(t + x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.05e-110) || ~((y <= 2.5e-147))) tmp = (a + z) - b; else tmp = z * (x / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.05e-110], N[Not[LessEqual[y, 2.5e-147]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-110} \lor \neg \left(y \leq 2.5 \cdot 10^{-147}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x}{t + x}\\
\end{array}
\end{array}
if y < -2.04999999999999991e-110 or 2.50000000000000007e-147 < y Initial program 49.4%
Taylor expanded in y around inf 68.8%
if -2.04999999999999991e-110 < y < 2.50000000000000007e-147Initial program 76.8%
Taylor expanded in z around inf 43.7%
associate-/l*52.2%
+-commutative52.2%
+-commutative52.2%
associate-+r+52.2%
Simplified52.2%
Taylor expanded in y around 0 50.7%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7.2e+162) (- a (* y (/ b t))) (if (<= t 2e+156) (- (+ a z) b) (+ a (* y (/ z t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.2e+162) {
tmp = a - (y * (b / t));
} else if (t <= 2e+156) {
tmp = (a + z) - b;
} else {
tmp = a + (y * (z / 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 (t <= (-7.2d+162)) then
tmp = a - (y * (b / t))
else if (t <= 2d+156) then
tmp = (a + z) - b
else
tmp = a + (y * (z / 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 (t <= -7.2e+162) {
tmp = a - (y * (b / t));
} else if (t <= 2e+156) {
tmp = (a + z) - b;
} else {
tmp = a + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.2e+162: tmp = a - (y * (b / t)) elif t <= 2e+156: tmp = (a + z) - b else: tmp = a + (y * (z / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.2e+162) tmp = Float64(a - Float64(y * Float64(b / t))); elseif (t <= 2e+156) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.2e+162) tmp = a - (y * (b / t)); elseif (t <= 2e+156) tmp = (a + z) - b; else tmp = a + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.2e+162], N[(a - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+156], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+162}:\\
\;\;\;\;a - y \cdot \frac{b}{t}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+156}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if t < -7.19999999999999987e162Initial program 42.4%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 74.3%
Taylor expanded in z around 0 71.3%
neg-mul-171.3%
distribute-neg-frac71.3%
Simplified71.3%
if -7.19999999999999987e162 < t < 2e156Initial program 59.4%
Taylor expanded in y around inf 64.5%
if 2e156 < t Initial program 50.6%
Taylor expanded in x around 0 43.4%
Taylor expanded in y around 0 76.6%
Taylor expanded in b around 0 62.3%
associate-/l*69.5%
Simplified69.5%
Final simplification65.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.5e+86) z (if (<= z 3.4e-45) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.5e+86) {
tmp = z;
} else if (z <= 3.4e-45) {
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 <= (-5.5d+86)) then
tmp = z
else if (z <= 3.4d-45) 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 <= -5.5e+86) {
tmp = z;
} else if (z <= 3.4e-45) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.5e+86: tmp = z elif z <= 3.4e-45: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.5e+86) tmp = z; elseif (z <= 3.4e-45) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.5e+86) tmp = z; elseif (z <= 3.4e-45) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.5e+86], z, If[LessEqual[z, 3.4e-45], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+86}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-45}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -5.5000000000000002e86 or 3.40000000000000004e-45 < z Initial program 44.4%
Taylor expanded in x around inf 49.0%
if -5.5000000000000002e86 < z < 3.40000000000000004e-45Initial program 66.4%
Taylor expanded in t around inf 49.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.2e+160) a (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e+160) {
tmp = a;
} else {
tmp = (a + z) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.2d+160)) then
tmp = a
else
tmp = (a + z) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e+160) {
tmp = a;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.2e+160: tmp = a else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.2e+160) tmp = a; else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.2e+160) tmp = a; else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.2e+160], a, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+160}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -1.2000000000000001e160Initial program 42.4%
Taylor expanded in t around inf 64.9%
if -1.2000000000000001e160 < t Initial program 58.3%
Taylor expanded in y around inf 61.1%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 56.5%
Taylor expanded in t around inf 36.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 2024182
(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)))