
(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 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) t_1))
(t_3 (- (+ z a) b)))
(if (<= t_2 -2e+275)
t_3
(if (<= t_2 5e+299)
t_2
(if (<= t_2 INFINITY) (+ z (* a (/ (+ y t) t_1))) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -2e+275) {
tmp = t_3;
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = z + (a * ((y + t) / t_1));
} else {
tmp = t_3;
}
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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -2e+275) {
tmp = t_3;
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = z + (a * ((y + t) / t_1));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / t_1 t_3 = (z + a) - b tmp = 0 if t_2 <= -2e+275: tmp = t_3 elif t_2 <= 5e+299: tmp = t_2 elif t_2 <= math.inf: tmp = z + (a * ((y + t) / t_1)) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_2 <= -2e+275) tmp = t_3; elseif (t_2 <= 5e+299) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(z + Float64(a * Float64(Float64(y + t) / t_1))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / t_1; t_3 = (z + a) - b; tmp = 0.0; if (t_2 <= -2e+275) tmp = t_3; elseif (t_2 <= 5e+299) tmp = t_2; elseif (t_2 <= Inf) tmp = z + (a * ((y + t) / t_1)); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+275], t$95$3, If[LessEqual[t$95$2, 5e+299], t$95$2, If[LessEqual[t$95$2, Infinity], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+275}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;z + a \cdot \frac{y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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)) < -1.99999999999999992e275 or +inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 10.9%
Taylor expanded in y around inf 81.6%
if -1.99999999999999992e275 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000003e299Initial program 99.6%
if 5.0000000000000003e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < +inf.0Initial program 5.8%
Taylor expanded in b around 0 5.8%
mul-1-neg5.8%
+-commutative5.8%
associate-+l+5.8%
associate-/l*39.6%
+-commutative39.6%
associate-+r+39.6%
+-commutative39.6%
associate-+l+39.6%
sub-neg39.6%
div-sub39.6%
Simplified39.0%
Taylor expanded in x around inf 71.7%
Final simplification89.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (+ (* a (/ (+ y t) t_1)) (* x (/ z (+ x t)))))
(t_3 (- (+ z a) b)))
(if (<= y -3.4e+191)
t_3
(if (<= y -1.2e+109)
t_2
(if (<= y -6.4e+76)
(+ (/ (* x z) t_1) (* y (/ (- z b) t_1)))
(if (<= y 1.15e+31) t_2 t_3))))))
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)) + (x * (z / (x + t)));
double t_3 = (z + a) - b;
double tmp;
if (y <= -3.4e+191) {
tmp = t_3;
} else if (y <= -1.2e+109) {
tmp = t_2;
} else if (y <= -6.4e+76) {
tmp = ((x * z) / t_1) + (y * ((z - b) / t_1));
} else if (y <= 1.15e+31) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (a * ((y + t) / t_1)) + (x * (z / (x + t)))
t_3 = (z + a) - b
if (y <= (-3.4d+191)) then
tmp = t_3
else if (y <= (-1.2d+109)) then
tmp = t_2
else if (y <= (-6.4d+76)) then
tmp = ((x * z) / t_1) + (y * ((z - b) / t_1))
else if (y <= 1.15d+31) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (a * ((y + t) / t_1)) + (x * (z / (x + t)));
double t_3 = (z + a) - b;
double tmp;
if (y <= -3.4e+191) {
tmp = t_3;
} else if (y <= -1.2e+109) {
tmp = t_2;
} else if (y <= -6.4e+76) {
tmp = ((x * z) / t_1) + (y * ((z - b) / t_1));
} else if (y <= 1.15e+31) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (a * ((y + t) / t_1)) + (x * (z / (x + t))) t_3 = (z + a) - b tmp = 0 if y <= -3.4e+191: tmp = t_3 elif y <= -1.2e+109: tmp = t_2 elif y <= -6.4e+76: tmp = ((x * z) / t_1) + (y * ((z - b) / t_1)) elif y <= 1.15e+31: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(a * Float64(Float64(y + t) / t_1)) + Float64(x * Float64(z / Float64(x + t)))) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -3.4e+191) tmp = t_3; elseif (y <= -1.2e+109) tmp = t_2; elseif (y <= -6.4e+76) tmp = Float64(Float64(Float64(x * z) / t_1) + Float64(y * Float64(Float64(z - b) / t_1))); elseif (y <= 1.15e+31) tmp = t_2; else tmp = t_3; 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)) + (x * (z / (x + t))); t_3 = (z + a) - b; tmp = 0.0; if (y <= -3.4e+191) tmp = t_3; elseif (y <= -1.2e+109) tmp = t_2; elseif (y <= -6.4e+76) tmp = ((x * z) / t_1) + (y * ((z - b) / t_1)); elseif (y <= 1.15e+31) tmp = t_2; else tmp = t_3; 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[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.4e+191], t$95$3, If[LessEqual[y, -1.2e+109], t$95$2, If[LessEqual[y, -6.4e+76], N[(N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(y * N[(N[(z - b), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+31], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \frac{y + t}{t\_1} + x \cdot \frac{z}{x + t}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+191}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{+109}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -6.4 \cdot 10^{+76}:\\
\;\;\;\;\frac{x \cdot z}{t\_1} + y \cdot \frac{z - b}{t\_1}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -3.40000000000000009e191 or 1.15e31 < y Initial program 40.0%
Taylor expanded in y around inf 81.7%
if -3.40000000000000009e191 < y < -1.19999999999999994e109 or -6.39999999999999953e76 < y < 1.15e31Initial program 73.2%
Taylor expanded in b around 0 73.2%
mul-1-neg73.2%
+-commutative73.2%
associate-+l+73.2%
associate-/l*84.7%
+-commutative84.7%
associate-+r+84.7%
+-commutative84.7%
associate-+l+84.7%
sub-neg84.7%
div-sub84.7%
Simplified84.6%
Taylor expanded in y around 0 72.5%
associate-/l*77.0%
Simplified77.0%
if -1.19999999999999994e109 < y < -6.39999999999999953e76Initial program 52.3%
Taylor expanded in a around -inf 42.7%
Simplified44.5%
Taylor expanded in a around 0 44.3%
associate-+r+44.3%
+-commutative44.3%
associate-/l*89.8%
associate-+r+89.8%
+-commutative89.8%
Simplified89.8%
Final simplification79.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (or (<= b -2.4e+43) (not (<= b 2.2e+174)))
(+ (/ (* x z) t_1) (* (/ y t_1) (- z b)))
(+ z (* a (/ (+ y t) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((b <= -2.4e+43) || !(b <= 2.2e+174)) {
tmp = ((x * z) / t_1) + ((y / t_1) * (z - b));
} else {
tmp = z + (a * ((y + t) / 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 = y + (x + t)
if ((b <= (-2.4d+43)) .or. (.not. (b <= 2.2d+174))) then
tmp = ((x * z) / t_1) + ((y / t_1) * (z - b))
else
tmp = z + (a * ((y + t) / 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 = y + (x + t);
double tmp;
if ((b <= -2.4e+43) || !(b <= 2.2e+174)) {
tmp = ((x * z) / t_1) + ((y / t_1) * (z - b));
} else {
tmp = z + (a * ((y + t) / t_1));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if (b <= -2.4e+43) or not (b <= 2.2e+174): tmp = ((x * z) / t_1) + ((y / t_1) * (z - b)) else: tmp = z + (a * ((y + t) / t_1)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if ((b <= -2.4e+43) || !(b <= 2.2e+174)) tmp = Float64(Float64(Float64(x * z) / t_1) + Float64(Float64(y / t_1) * Float64(z - b))); else tmp = Float64(z + Float64(a * Float64(Float64(y + t) / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if ((b <= -2.4e+43) || ~((b <= 2.2e+174))) tmp = ((x * z) / t_1) + ((y / t_1) * (z - b)); else tmp = z + (a * ((y + t) / 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]}, If[Or[LessEqual[b, -2.4e+43], N[Not[LessEqual[b, 2.2e+174]], $MachinePrecision]], N[(N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(y / t$95$1), $MachinePrecision] * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{+43} \lor \neg \left(b \leq 2.2 \cdot 10^{+174}\right):\\
\;\;\;\;\frac{x \cdot z}{t\_1} + \frac{y}{t\_1} \cdot \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \frac{y + t}{t\_1}\\
\end{array}
\end{array}
if b < -2.40000000000000023e43 or 2.2000000000000002e174 < b Initial program 45.9%
Taylor expanded in a around -inf 49.0%
Simplified49.2%
Taylor expanded in a around 0 38.4%
associate-+r+38.4%
+-commutative38.4%
associate-/l*64.6%
associate-+r+64.6%
+-commutative64.6%
Simplified64.6%
clear-num64.4%
un-div-inv65.6%
+-commutative65.6%
+-commutative65.6%
associate-+l+65.6%
Applied egg-rr65.6%
associate-/r/69.2%
associate-+r+69.2%
Simplified69.2%
if -2.40000000000000023e43 < b < 2.2000000000000002e174Initial program 65.3%
Taylor expanded in b around 0 65.4%
mul-1-neg65.4%
+-commutative65.4%
associate-+l+65.4%
associate-/l*77.7%
+-commutative77.7%
associate-+r+77.7%
+-commutative77.7%
associate-+l+77.7%
sub-neg77.7%
div-sub77.7%
Simplified77.5%
Taylor expanded in x around inf 79.0%
Final simplification76.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -4e-36)
t_1
(if (<= y -4.8e-259)
(+ z a)
(if (<= y -7.2e-305)
(* x (/ z (+ x t)))
(if (<= y 9.2e-61) (+ z a) 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 <= -4e-36) {
tmp = t_1;
} else if (y <= -4.8e-259) {
tmp = z + a;
} else if (y <= -7.2e-305) {
tmp = x * (z / (x + t));
} else if (y <= 9.2e-61) {
tmp = z + a;
} 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 <= (-4d-36)) then
tmp = t_1
else if (y <= (-4.8d-259)) then
tmp = z + a
else if (y <= (-7.2d-305)) then
tmp = x * (z / (x + t))
else if (y <= 9.2d-61) then
tmp = z + a
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 <= -4e-36) {
tmp = t_1;
} else if (y <= -4.8e-259) {
tmp = z + a;
} else if (y <= -7.2e-305) {
tmp = x * (z / (x + t));
} else if (y <= 9.2e-61) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -4e-36: tmp = t_1 elif y <= -4.8e-259: tmp = z + a elif y <= -7.2e-305: tmp = x * (z / (x + t)) elif y <= 9.2e-61: tmp = z + a 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 <= -4e-36) tmp = t_1; elseif (y <= -4.8e-259) tmp = Float64(z + a); elseif (y <= -7.2e-305) tmp = Float64(x * Float64(z / Float64(x + t))); elseif (y <= 9.2e-61) tmp = Float64(z + a); 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 <= -4e-36) tmp = t_1; elseif (y <= -4.8e-259) tmp = z + a; elseif (y <= -7.2e-305) tmp = x * (z / (x + t)); elseif (y <= 9.2e-61) tmp = z + a; 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, -4e-36], t$95$1, If[LessEqual[y, -4.8e-259], N[(z + a), $MachinePrecision], If[LessEqual[y, -7.2e-305], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-61], N[(z + a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-259}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-305}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-61}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999998e-36 or 9.19999999999999967e-61 < y Initial program 47.1%
Taylor expanded in y around inf 76.0%
if -3.9999999999999998e-36 < y < -4.8000000000000001e-259 or -7.20000000000000007e-305 < y < 9.19999999999999967e-61Initial program 77.5%
Taylor expanded in b around 0 77.5%
mul-1-neg77.5%
+-commutative77.5%
associate-+l+77.5%
associate-/l*90.7%
+-commutative90.7%
associate-+r+90.7%
+-commutative90.7%
associate-+l+90.7%
sub-neg90.7%
div-sub90.7%
Simplified90.7%
Taylor expanded in x around inf 78.1%
Taylor expanded in t around inf 54.8%
if -4.8000000000000001e-259 < y < -7.20000000000000007e-305Initial program 82.0%
Taylor expanded in y around 0 75.9%
Taylor expanded in a around 0 57.9%
associate-/l*70.1%
+-commutative70.1%
Simplified70.1%
Final simplification68.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -9.5e+62) (not (<= x 2.85e-41))) (+ z (* a (/ (+ y t) (+ y (+ x t))))) (* a (+ 1.0 (* y (/ (- z b) (* (+ y t) a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -9.5e+62) || !(x <= 2.85e-41)) {
tmp = z + (a * ((y + t) / (y + (x + t))));
} else {
tmp = a * (1.0 + (y * ((z - b) / ((y + t) * 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 ((x <= (-9.5d+62)) .or. (.not. (x <= 2.85d-41))) then
tmp = z + (a * ((y + t) / (y + (x + t))))
else
tmp = a * (1.0d0 + (y * ((z - b) / ((y + t) * 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 ((x <= -9.5e+62) || !(x <= 2.85e-41)) {
tmp = z + (a * ((y + t) / (y + (x + t))));
} else {
tmp = a * (1.0 + (y * ((z - b) / ((y + t) * a))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -9.5e+62) or not (x <= 2.85e-41): tmp = z + (a * ((y + t) / (y + (x + t)))) else: tmp = a * (1.0 + (y * ((z - b) / ((y + t) * a)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -9.5e+62) || !(x <= 2.85e-41)) tmp = Float64(z + Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t))))); else tmp = Float64(a * Float64(1.0 + Float64(y * Float64(Float64(z - b) / Float64(Float64(y + t) * a))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -9.5e+62) || ~((x <= 2.85e-41))) tmp = z + (a * ((y + t) / (y + (x + t)))); else tmp = a * (1.0 + (y * ((z - b) / ((y + t) * a)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -9.5e+62], N[Not[LessEqual[x, 2.85e-41]], $MachinePrecision]], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(y * N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+62} \lor \neg \left(x \leq 2.85 \cdot 10^{-41}\right):\\
\;\;\;\;z + a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + y \cdot \frac{z - b}{\left(y + t\right) \cdot a}\right)\\
\end{array}
\end{array}
if x < -9.5000000000000003e62 or 2.85000000000000023e-41 < x Initial program 52.6%
Taylor expanded in b around 0 52.6%
mul-1-neg52.6%
+-commutative52.6%
associate-+l+52.6%
associate-/l*61.9%
+-commutative61.9%
associate-+r+61.9%
+-commutative61.9%
associate-+l+61.9%
sub-neg61.9%
div-sub61.9%
Simplified61.5%
Taylor expanded in x around inf 76.8%
if -9.5000000000000003e62 < x < 2.85000000000000023e-41Initial program 67.5%
Taylor expanded in a around -inf 75.4%
Simplified75.7%
Taylor expanded in x around 0 65.3%
associate-/l*71.3%
*-commutative71.3%
+-commutative71.3%
Simplified71.3%
Final simplification74.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -5.3e+63) (not (<= x 4.5e-149))) (+ z (* 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 ((x <= -5.3e+63) || !(x <= 4.5e-149)) {
tmp = z + (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 ((x <= (-5.3d+63)) .or. (.not. (x <= 4.5d-149))) then
tmp = z + (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 ((x <= -5.3e+63) || !(x <= 4.5e-149)) {
tmp = z + (a * ((y + t) / (y + (x + t))));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -5.3e+63) or not (x <= 4.5e-149): tmp = z + (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 ((x <= -5.3e+63) || !(x <= 4.5e-149)) tmp = Float64(z + 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 ((x <= -5.3e+63) || ~((x <= 4.5e-149))) tmp = z + (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[x, -5.3e+63], N[Not[LessEqual[x, 4.5e-149]], $MachinePrecision]], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.3 \cdot 10^{+63} \lor \neg \left(x \leq 4.5 \cdot 10^{-149}\right):\\
\;\;\;\;z + a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -5.2999999999999999e63 or 4.4999999999999998e-149 < x Initial program 56.3%
Taylor expanded in b around 0 56.3%
mul-1-neg56.3%
+-commutative56.3%
associate-+l+56.3%
associate-/l*66.7%
+-commutative66.7%
associate-+r+66.7%
+-commutative66.7%
associate-+l+66.7%
sub-neg66.7%
div-sub66.7%
Simplified66.4%
Taylor expanded in x around inf 75.6%
if -5.2999999999999999e63 < x < 4.4999999999999998e-149Initial program 65.3%
Taylor expanded in y around inf 71.0%
Final simplification73.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.22e+120) (+ z (* a (/ (+ y t) x))) (if (<= x 7e+199) (- (+ z a) b) (+ z (* y (- (/ a x) (/ b x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.22e+120) {
tmp = z + (a * ((y + t) / x));
} else if (x <= 7e+199) {
tmp = (z + a) - b;
} else {
tmp = z + (y * ((a / x) - (b / 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 (x <= (-1.22d+120)) then
tmp = z + (a * ((y + t) / x))
else if (x <= 7d+199) then
tmp = (z + a) - b
else
tmp = z + (y * ((a / x) - (b / 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 (x <= -1.22e+120) {
tmp = z + (a * ((y + t) / x));
} else if (x <= 7e+199) {
tmp = (z + a) - b;
} else {
tmp = z + (y * ((a / x) - (b / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.22e+120: tmp = z + (a * ((y + t) / x)) elif x <= 7e+199: tmp = (z + a) - b else: tmp = z + (y * ((a / x) - (b / x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.22e+120) tmp = Float64(z + Float64(a * Float64(Float64(y + t) / x))); elseif (x <= 7e+199) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.22e+120) tmp = z + (a * ((y + t) / x)); elseif (x <= 7e+199) tmp = (z + a) - b; else tmp = z + (y * ((a / x) - (b / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.22e+120], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+199], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{+120}:\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+199}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\end{array}
\end{array}
if x < -1.22e120Initial program 45.8%
Taylor expanded in b around 0 45.7%
mul-1-neg45.7%
+-commutative45.7%
associate-+l+45.7%
associate-/l*49.7%
+-commutative49.7%
associate-+r+49.7%
+-commutative49.7%
associate-+l+49.7%
sub-neg49.7%
div-sub49.7%
Simplified49.0%
Taylor expanded in x around inf 77.8%
Taylor expanded in x around inf 66.3%
associate-/l*72.9%
+-commutative72.9%
Simplified72.9%
if -1.22e120 < x < 6.99999999999999962e199Initial program 64.6%
Taylor expanded in y around inf 66.2%
if 6.99999999999999962e199 < x Initial program 45.7%
Taylor expanded in t around 0 40.2%
Taylor expanded in y around 0 83.2%
Final simplification69.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -9.2e+119) (not (<= x 1.6e+195))) (+ z (* a (/ (+ y t) x))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -9.2e+119) || !(x <= 1.6e+195)) {
tmp = z + (a * ((y + t) / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-9.2d+119)) .or. (.not. (x <= 1.6d+195))) then
tmp = z + (a * ((y + t) / x))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -9.2e+119) || !(x <= 1.6e+195)) {
tmp = z + (a * ((y + t) / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -9.2e+119) or not (x <= 1.6e+195): tmp = z + (a * ((y + t) / x)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -9.2e+119) || !(x <= 1.6e+195)) tmp = Float64(z + Float64(a * Float64(Float64(y + t) / x))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -9.2e+119) || ~((x <= 1.6e+195))) tmp = z + (a * ((y + t) / x)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -9.2e+119], N[Not[LessEqual[x, 1.6e+195]], $MachinePrecision]], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+119} \lor \neg \left(x \leq 1.6 \cdot 10^{+195}\right):\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -9.2000000000000003e119 or 1.59999999999999991e195 < x Initial program 45.1%
Taylor expanded in b around 0 45.1%
mul-1-neg45.1%
+-commutative45.1%
associate-+l+45.1%
associate-/l*48.3%
+-commutative48.3%
associate-+r+48.3%
+-commutative48.3%
associate-+l+48.3%
sub-neg48.3%
div-sub48.3%
Simplified47.8%
Taylor expanded in x around inf 78.4%
Taylor expanded in x around inf 66.8%
associate-/l*75.6%
+-commutative75.6%
Simplified75.6%
if -9.2000000000000003e119 < x < 1.59999999999999991e195Initial program 64.9%
Taylor expanded in y around inf 66.5%
Final simplification68.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.75e-36) (not (<= y 1.04e-54))) (- (+ z a) b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.75e-36) || !(y <= 1.04e-54)) {
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 <= (-1.75d-36)) .or. (.not. (y <= 1.04d-54))) 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 <= -1.75e-36) || !(y <= 1.04e-54)) {
tmp = (z + a) - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.75e-36) or not (y <= 1.04e-54): tmp = (z + a) - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.75e-36) || !(y <= 1.04e-54)) 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 <= -1.75e-36) || ~((y <= 1.04e-54))) tmp = (z + a) - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.75e-36], N[Not[LessEqual[y, 1.04e-54]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-36} \lor \neg \left(y \leq 1.04 \cdot 10^{-54}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -1.75e-36 or 1.04e-54 < y Initial program 47.1%
Taylor expanded in y around inf 76.0%
if -1.75e-36 < y < 1.04e-54Initial program 78.1%
Taylor expanded in b around 0 78.2%
mul-1-neg78.2%
+-commutative78.2%
associate-+l+78.2%
associate-/l*89.1%
+-commutative89.1%
associate-+r+89.1%
+-commutative89.1%
associate-+l+89.1%
sub-neg89.1%
div-sub89.1%
Simplified89.1%
Taylor expanded in x around inf 76.6%
Taylor expanded in t around inf 52.8%
Final simplification66.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.5e-26) (not (<= z 8.8e-113))) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.5e-26) || !(z <= 8.8e-113)) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-7.5d-26)) .or. (.not. (z <= 8.8d-113))) then
tmp = z + a
else
tmp = a - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.5e-26) || !(z <= 8.8e-113)) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.5e-26) or not (z <= 8.8e-113): tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.5e-26) || !(z <= 8.8e-113)) tmp = Float64(z + a); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.5e-26) || ~((z <= 8.8e-113))) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.5e-26], N[Not[LessEqual[z, 8.8e-113]], $MachinePrecision]], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-26} \lor \neg \left(z \leq 8.8 \cdot 10^{-113}\right):\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if z < -7.4999999999999994e-26 or 8.80000000000000016e-113 < z Initial program 50.6%
Taylor expanded in b around 0 50.6%
mul-1-neg50.6%
+-commutative50.6%
associate-+l+50.6%
associate-/l*60.2%
+-commutative60.2%
associate-+r+60.2%
+-commutative60.2%
associate-+l+60.2%
sub-neg60.2%
div-sub60.2%
Simplified60.0%
Taylor expanded in x around inf 73.1%
Taylor expanded in t around inf 59.6%
if -7.4999999999999994e-26 < z < 8.80000000000000016e-113Initial program 72.5%
Taylor expanded in z around 0 62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in y around inf 56.6%
Final simplification58.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.65e+41) a (if (<= t 2.55e-21) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.65e+41) {
tmp = a;
} else if (t <= 2.55e-21) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.65d+41)) then
tmp = a
else if (t <= 2.55d-21) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.65e+41) {
tmp = a;
} else if (t <= 2.55e-21) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.65e+41: tmp = a elif t <= 2.55e-21: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.65e+41) tmp = a; elseif (t <= 2.55e-21) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.65e+41) tmp = a; elseif (t <= 2.55e-21) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.65e+41], a, If[LessEqual[t, 2.55e-21], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.65 \cdot 10^{+41}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -2.6499999999999998e41 or 2.55000000000000002e-21 < t Initial program 48.1%
Taylor expanded in t around inf 52.6%
if -2.6499999999999998e41 < t < 2.55000000000000002e-21Initial program 68.4%
Taylor expanded in x around inf 47.2%
Final simplification49.4%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + 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 = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 59.8%
Taylor expanded in b around 0 59.8%
mul-1-neg59.8%
+-commutative59.8%
associate-+l+59.8%
associate-/l*70.7%
+-commutative70.7%
associate-+r+70.7%
+-commutative70.7%
associate-+l+70.7%
sub-neg70.7%
div-sub70.6%
Simplified70.5%
Taylor expanded in x around inf 67.7%
Taylor expanded in t around inf 53.1%
Final simplification53.1%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 59.8%
Taylor expanded in t around inf 31.4%
Final simplification31.4%
(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 2024059
(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)))