
(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 16 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 (/ y t_1)) (t_3 (/ (+ y t) t_1)))
(if (or (<= b -1.55e-31) (not (<= b 6.2e-73)))
(* b (- (fma -1.0 (/ (+ (* a t_3) (* z (/ (+ y x) t_1))) b) t_2)))
(* z (+ (/ x t_1) (- (+ t_2 (* t_3 (/ a z))) (/ (/ (* b y) z) t_1)))))))
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_1;
double t_3 = (y + t) / t_1;
double tmp;
if ((b <= -1.55e-31) || !(b <= 6.2e-73)) {
tmp = b * -fma(-1.0, (((a * t_3) + (z * ((y + x) / t_1))) / b), t_2);
} else {
tmp = z * ((x / t_1) + ((t_2 + (t_3 * (a / z))) - (((b * y) / z) / t_1)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(y / t_1) t_3 = Float64(Float64(y + t) / t_1) tmp = 0.0 if ((b <= -1.55e-31) || !(b <= 6.2e-73)) tmp = Float64(b * Float64(-fma(-1.0, Float64(Float64(Float64(a * t_3) + Float64(z * Float64(Float64(y + x) / t_1))) / b), t_2))); else tmp = Float64(z * Float64(Float64(x / t_1) + Float64(Float64(t_2 + Float64(t_3 * Float64(a / z))) - Float64(Float64(Float64(b * y) / z) / t_1)))); 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[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[b, -1.55e-31], N[Not[LessEqual[b, 6.2e-73]], $MachinePrecision]], N[(b * (-N[(-1.0 * N[(N[(N[(a * t$95$3), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] + t$95$2), $MachinePrecision])), $MachinePrecision], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(t$95$2 + N[(t$95$3 * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(b * y), $MachinePrecision] / z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := \frac{y}{t\_1}\\
t_3 := \frac{y + t}{t\_1}\\
\mathbf{if}\;b \leq -1.55 \cdot 10^{-31} \lor \neg \left(b \leq 6.2 \cdot 10^{-73}\right):\\
\;\;\;\;b \cdot \left(-\mathsf{fma}\left(-1, \frac{a \cdot t\_3 + z \cdot \frac{y + x}{t\_1}}{b}, t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\left(t\_2 + t\_3 \cdot \frac{a}{z}\right) - \frac{\frac{b \cdot y}{z}}{t\_1}\right)\right)\\
\end{array}
\end{array}
if b < -1.55e-31 or 6.19999999999999938e-73 < b Initial program 60.5%
Taylor expanded in b around -inf 62.9%
associate-*r*62.9%
neg-mul-162.9%
fma-define62.9%
Simplified95.7%
if -1.55e-31 < b < 6.19999999999999938e-73Initial program 62.0%
Taylor expanded in z around inf 71.8%
associate--l+71.8%
+-commutative71.8%
associate-+r+71.8%
+-commutative71.8%
associate-+r+71.8%
times-frac85.5%
+-commutative85.5%
+-commutative85.5%
associate-+r+85.5%
associate-/r*84.5%
Simplified84.5%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (/ (- (+ t_1 (* z (+ y x))) (* b y)) (+ y (+ t x)))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 4e+248)))
(- (+ a z) b)
(/ (- (fma (+ y x) z t_1) (* b y)) (+ (+ y t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = ((t_1 + (z * (y + x))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 4e+248)) {
tmp = (a + z) - b;
} else {
tmp = (fma((y + x), z, t_1) - (b * y)) / ((y + t) + x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(Float64(Float64(t_1 + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(y + Float64(t + x))) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 4e+248)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(fma(Float64(y + x), z, t_1) - Float64(b * y)) / Float64(Float64(y + t) + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 4e+248]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := \frac{\left(t\_1 + z \cdot \left(y + x\right)\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 4 \cdot 10^{+248}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right) - b \cdot y}{\left(y + t\right) + x}\\
\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 4.00000000000000018e248 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.3%
Taylor expanded in y around inf 68.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000018e248Initial program 99.6%
fma-define99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
Simplified99.6%
Final simplification86.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* a (+ y t)) (* z (+ y x))) (* b y)) (+ y (+ t x))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+248))) (- (+ a z) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+248)) {
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 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+248)) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 4e+248): tmp = (a + z) - 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(y + x))) - Float64(b * y)) / Float64(y + Float64(t + x))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+248)) 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 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 4e+248))) 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[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(y + x), $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, 4e+248]], $MachinePrecision]], N[(N[(a + z), $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(y + x\right)\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 4 \cdot 10^{+248}\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 4.00000000000000018e248 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.3%
Taylor expanded in y around inf 68.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000018e248Initial program 99.6%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -8.2e-37)
t_1
(if (<= y 3.9e-263)
(/ (- (+ (* a t) (* x z)) (* b y)) (+ (+ y t) x))
(if (<= y 9e+97) (+ (* a (/ t (+ t x))) (* x (/ z (+ 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 <= -8.2e-37) {
tmp = t_1;
} else if (y <= 3.9e-263) {
tmp = (((a * t) + (x * z)) - (b * y)) / ((y + t) + x);
} else if (y <= 9e+97) {
tmp = (a * (t / (t + x))) + (x * (z / (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 <= (-8.2d-37)) then
tmp = t_1
else if (y <= 3.9d-263) then
tmp = (((a * t) + (x * z)) - (b * y)) / ((y + t) + x)
else if (y <= 9d+97) then
tmp = (a * (t / (t + x))) + (x * (z / (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 <= -8.2e-37) {
tmp = t_1;
} else if (y <= 3.9e-263) {
tmp = (((a * t) + (x * z)) - (b * y)) / ((y + t) + x);
} else if (y <= 9e+97) {
tmp = (a * (t / (t + x))) + (x * (z / (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 <= -8.2e-37: tmp = t_1 elif y <= 3.9e-263: tmp = (((a * t) + (x * z)) - (b * y)) / ((y + t) + x) elif y <= 9e+97: tmp = (a * (t / (t + x))) + (x * (z / (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 <= -8.2e-37) tmp = t_1; elseif (y <= 3.9e-263) tmp = Float64(Float64(Float64(Float64(a * t) + Float64(x * z)) - Float64(b * y)) / Float64(Float64(y + t) + x)); elseif (y <= 9e+97) tmp = Float64(Float64(a * Float64(t / Float64(t + x))) + Float64(x * Float64(z / 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 <= -8.2e-37) tmp = t_1; elseif (y <= 3.9e-263) tmp = (((a * t) + (x * z)) - (b * y)) / ((y + t) + x); elseif (y <= 9e+97) tmp = (a * (t / (t + x))) + (x * (z / (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, -8.2e-37], t$95$1, If[LessEqual[y, 3.9e-263], N[(N[(N[(N[(a * t), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+97], N[(N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-263}:\\
\;\;\;\;\frac{\left(a \cdot t + x \cdot z\right) - b \cdot y}{\left(y + t\right) + x}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+97}:\\
\;\;\;\;a \cdot \frac{t}{t + x} + x \cdot \frac{z}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.1999999999999996e-37 or 8.99999999999999952e97 < y Initial program 42.4%
Taylor expanded in y around inf 73.6%
if -8.1999999999999996e-37 < y < 3.8999999999999997e-263Initial program 83.0%
fma-define83.0%
+-commutative83.0%
associate-+l+83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in y around 0 75.0%
if 3.8999999999999997e-263 < y < 8.99999999999999952e97Initial program 66.4%
Taylor expanded in b around -inf 57.6%
associate-*r*57.6%
neg-mul-157.6%
fma-define57.6%
Simplified76.7%
Taylor expanded in y around 0 41.7%
associate-/l*54.4%
associate-/l*67.1%
Simplified67.1%
Final simplification72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -1.8e-37)
t_1
(if (<= y -2.5e-122)
(/ (- (* z (+ y x)) (* b y)) (+ y (+ t x)))
(if (<= y 2.45e+98) (+ (* a (/ t (+ t x))) (* x (/ z (+ 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 <= -1.8e-37) {
tmp = t_1;
} else if (y <= -2.5e-122) {
tmp = ((z * (y + x)) - (b * y)) / (y + (t + x));
} else if (y <= 2.45e+98) {
tmp = (a * (t / (t + x))) + (x * (z / (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 <= (-1.8d-37)) then
tmp = t_1
else if (y <= (-2.5d-122)) then
tmp = ((z * (y + x)) - (b * y)) / (y + (t + x))
else if (y <= 2.45d+98) then
tmp = (a * (t / (t + x))) + (x * (z / (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 <= -1.8e-37) {
tmp = t_1;
} else if (y <= -2.5e-122) {
tmp = ((z * (y + x)) - (b * y)) / (y + (t + x));
} else if (y <= 2.45e+98) {
tmp = (a * (t / (t + x))) + (x * (z / (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 <= -1.8e-37: tmp = t_1 elif y <= -2.5e-122: tmp = ((z * (y + x)) - (b * y)) / (y + (t + x)) elif y <= 2.45e+98: tmp = (a * (t / (t + x))) + (x * (z / (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 <= -1.8e-37) tmp = t_1; elseif (y <= -2.5e-122) tmp = Float64(Float64(Float64(z * Float64(y + x)) - Float64(b * y)) / Float64(y + Float64(t + x))); elseif (y <= 2.45e+98) tmp = Float64(Float64(a * Float64(t / Float64(t + x))) + Float64(x * Float64(z / 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 <= -1.8e-37) tmp = t_1; elseif (y <= -2.5e-122) tmp = ((z * (y + x)) - (b * y)) / (y + (t + x)); elseif (y <= 2.45e+98) tmp = (a * (t / (t + x))) + (x * (z / (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, -1.8e-37], t$95$1, If[LessEqual[y, -2.5e-122], N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+98], N[(N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-122}:\\
\;\;\;\;\frac{z \cdot \left(y + x\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+98}:\\
\;\;\;\;a \cdot \frac{t}{t + x} + x \cdot \frac{z}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.80000000000000004e-37 or 2.4499999999999999e98 < y Initial program 42.4%
Taylor expanded in y around inf 73.6%
if -1.80000000000000004e-37 < y < -2.4999999999999999e-122Initial program 81.3%
Taylor expanded in a around 0 70.5%
+-commutative70.5%
*-commutative70.5%
Simplified70.5%
if -2.4999999999999999e-122 < y < 2.4499999999999999e98Initial program 73.3%
Taylor expanded in b around -inf 64.4%
associate-*r*64.4%
neg-mul-164.4%
fma-define64.4%
Simplified78.4%
Taylor expanded in y around 0 51.1%
associate-/l*61.1%
associate-/l*69.8%
Simplified69.8%
Final simplification71.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (* a (/ t (+ t x))))) (t_2 (- (+ a z) b)))
(if (<= y -1.9e-30)
t_2
(if (<= y -1.8e-174)
t_1
(if (<= y 3.8e-249)
(/ (+ (* a t) (* x z)) (+ t x))
(if (<= y 9e+97) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a * (t / (t + x)));
double t_2 = (a + z) - b;
double tmp;
if (y <= -1.9e-30) {
tmp = t_2;
} else if (y <= -1.8e-174) {
tmp = t_1;
} else if (y <= 3.8e-249) {
tmp = ((a * t) + (x * z)) / (t + x);
} else if (y <= 9e+97) {
tmp = 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 = z + (a * (t / (t + x)))
t_2 = (a + z) - b
if (y <= (-1.9d-30)) then
tmp = t_2
else if (y <= (-1.8d-174)) then
tmp = t_1
else if (y <= 3.8d-249) then
tmp = ((a * t) + (x * z)) / (t + x)
else if (y <= 9d+97) then
tmp = 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 = z + (a * (t / (t + x)));
double t_2 = (a + z) - b;
double tmp;
if (y <= -1.9e-30) {
tmp = t_2;
} else if (y <= -1.8e-174) {
tmp = t_1;
} else if (y <= 3.8e-249) {
tmp = ((a * t) + (x * z)) / (t + x);
} else if (y <= 9e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (a * (t / (t + x))) t_2 = (a + z) - b tmp = 0 if y <= -1.9e-30: tmp = t_2 elif y <= -1.8e-174: tmp = t_1 elif y <= 3.8e-249: tmp = ((a * t) + (x * z)) / (t + x) elif y <= 9e+97: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(a * Float64(t / Float64(t + x)))) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1.9e-30) tmp = t_2; elseif (y <= -1.8e-174) tmp = t_1; elseif (y <= 3.8e-249) tmp = Float64(Float64(Float64(a * t) + Float64(x * z)) / Float64(t + x)); elseif (y <= 9e+97) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (a * (t / (t + x))); t_2 = (a + z) - b; tmp = 0.0; if (y <= -1.9e-30) tmp = t_2; elseif (y <= -1.8e-174) tmp = t_1; elseif (y <= 3.8e-249) tmp = ((a * t) + (x * z)) / (t + x); elseif (y <= 9e+97) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.9e-30], t$95$2, If[LessEqual[y, -1.8e-174], t$95$1, If[LessEqual[y, 3.8e-249], N[(N[(N[(a * t), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+97], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + a \cdot \frac{t}{t + x}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-249}:\\
\;\;\;\;\frac{a \cdot t + x \cdot z}{t + x}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.9000000000000002e-30 or 8.99999999999999952e97 < y Initial program 42.8%
Taylor expanded in y around inf 73.4%
if -1.9000000000000002e-30 < y < -1.79999999999999999e-174 or 3.8000000000000001e-249 < y < 8.99999999999999952e97Initial program 66.7%
Taylor expanded in b around -inf 59.1%
associate-*r*59.1%
neg-mul-159.1%
fma-define59.1%
Simplified78.6%
Taylor expanded in y around 0 37.1%
associate-/l*48.9%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in x around inf 59.3%
if -1.79999999999999999e-174 < y < 3.8000000000000001e-249Initial program 97.1%
Taylor expanded in y around 0 74.0%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.65e-61) (not (<= y 1.15e+98))) (- (+ a z) b) (+ (* a (/ t (+ t x))) (* x (/ z (+ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.65e-61) || !(y <= 1.15e+98)) {
tmp = (a + z) - b;
} else {
tmp = (a * (t / (t + x))) + (x * (z / (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.65d-61)) .or. (.not. (y <= 1.15d+98))) then
tmp = (a + z) - b
else
tmp = (a * (t / (t + x))) + (x * (z / (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.65e-61) || !(y <= 1.15e+98)) {
tmp = (a + z) - b;
} else {
tmp = (a * (t / (t + x))) + (x * (z / (t + x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.65e-61) or not (y <= 1.15e+98): tmp = (a + z) - b else: tmp = (a * (t / (t + x))) + (x * (z / (t + x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.65e-61) || !(y <= 1.15e+98)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(a * Float64(t / Float64(t + x))) + Float64(x * Float64(z / Float64(t + x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.65e-61) || ~((y <= 1.15e+98))) tmp = (a + z) - b; else tmp = (a * (t / (t + x))) + (x * (z / (t + x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.65e-61], N[Not[LessEqual[y, 1.15e+98]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-61} \lor \neg \left(y \leq 1.15 \cdot 10^{+98}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t}{t + x} + x \cdot \frac{z}{t + x}\\
\end{array}
\end{array}
if y < -1.64999999999999998e-61 or 1.15000000000000007e98 < y Initial program 45.7%
Taylor expanded in y around inf 71.0%
if -1.64999999999999998e-61 < y < 1.15000000000000007e98Initial program 74.3%
Taylor expanded in b around -inf 65.7%
associate-*r*65.7%
neg-mul-165.7%
fma-define65.7%
Simplified79.5%
Taylor expanded in y around 0 47.8%
associate-/l*56.6%
associate-/l*66.4%
Simplified66.4%
Final simplification68.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9.2e-35) (not (<= y 9.6e+97))) (- (+ a z) b) (+ z (* a (/ t (+ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9.2e-35) || !(y <= 9.6e+97)) {
tmp = (a + z) - b;
} else {
tmp = 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 <= (-9.2d-35)) .or. (.not. (y <= 9.6d+97))) then
tmp = (a + z) - b
else
tmp = 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 <= -9.2e-35) || !(y <= 9.6e+97)) {
tmp = (a + z) - b;
} else {
tmp = z + (a * (t / (t + x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9.2e-35) or not (y <= 9.6e+97): tmp = (a + z) - b else: tmp = z + (a * (t / (t + x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9.2e-35) || !(y <= 9.6e+97)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z + Float64(a * Float64(t / Float64(t + x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9.2e-35) || ~((y <= 9.6e+97))) tmp = (a + z) - b; else tmp = z + (a * (t / (t + x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9.2e-35], N[Not[LessEqual[y, 9.6e+97]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{-35} \lor \neg \left(y \leq 9.6 \cdot 10^{+97}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \frac{t}{t + x}\\
\end{array}
\end{array}
if y < -9.1999999999999996e-35 or 9.6000000000000001e97 < y Initial program 42.8%
Taylor expanded in y around inf 73.4%
if -9.1999999999999996e-35 < y < 9.6000000000000001e97Initial program 74.3%
Taylor expanded in b around -inf 65.7%
associate-*r*65.7%
neg-mul-165.7%
fma-define65.7%
Simplified79.1%
Taylor expanded in y around 0 46.3%
associate-/l*55.1%
associate-/l*64.4%
Simplified64.4%
Taylor expanded in x around inf 57.0%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e-121) (not (<= y 1.45e+98))) (- (+ a z) b) (+ a (* x (/ z (+ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e-121) || !(y <= 1.45e+98)) {
tmp = (a + z) - b;
} else {
tmp = a + (x * (z / (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.55d-121)) .or. (.not. (y <= 1.45d+98))) then
tmp = (a + z) - b
else
tmp = a + (x * (z / (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.55e-121) || !(y <= 1.45e+98)) {
tmp = (a + z) - b;
} else {
tmp = a + (x * (z / (t + x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.55e-121) or not (y <= 1.45e+98): tmp = (a + z) - b else: tmp = a + (x * (z / (t + x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e-121) || !(y <= 1.45e+98)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a + Float64(x * Float64(z / Float64(t + x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.55e-121) || ~((y <= 1.45e+98))) tmp = (a + z) - b; else tmp = a + (x * (z / (t + x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e-121], N[Not[LessEqual[y, 1.45e+98]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-121} \lor \neg \left(y \leq 1.45 \cdot 10^{+98}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + x \cdot \frac{z}{t + x}\\
\end{array}
\end{array}
if y < -1.5499999999999999e-121 or 1.45000000000000005e98 < y Initial program 49.6%
Taylor expanded in y around inf 66.7%
if -1.5499999999999999e-121 < y < 1.45000000000000005e98Initial program 73.5%
Taylor expanded in b around -inf 63.9%
associate-*r*63.9%
neg-mul-163.9%
fma-define63.9%
Simplified77.8%
Taylor expanded in y around 0 50.8%
associate-/l*60.7%
associate-/l*69.3%
Simplified69.3%
Taylor expanded in t around inf 53.6%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.8e+78) (- (+ a z) b) (* z (/ 1.0 (/ (+ t x) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.8e+78) {
tmp = (a + z) - b;
} else {
tmp = z * (1.0 / ((t + x) / 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 <= 2.8d+78) then
tmp = (a + z) - b
else
tmp = z * (1.0d0 / ((t + x) / 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 <= 2.8e+78) {
tmp = (a + z) - b;
} else {
tmp = z * (1.0 / ((t + x) / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.8e+78: tmp = (a + z) - b else: tmp = z * (1.0 / ((t + x) / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.8e+78) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z * Float64(1.0 / Float64(Float64(t + x) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 2.8e+78) tmp = (a + z) - b; else tmp = z * (1.0 / ((t + x) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.8e+78], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(1.0 / N[(N[(t + x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{+78}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{1}{\frac{t + x}{x}}\\
\end{array}
\end{array}
if x < 2.8000000000000001e78Initial program 63.6%
Taylor expanded in y around inf 54.8%
if 2.8000000000000001e78 < x Initial program 50.3%
Taylor expanded in z around inf 29.6%
associate-/l*63.2%
+-commutative63.2%
+-commutative63.2%
associate-+r+63.2%
Simplified63.2%
clear-num63.3%
inv-pow63.3%
associate-+r+63.3%
+-commutative63.3%
+-commutative63.3%
Applied egg-rr63.3%
unpow-163.3%
Simplified63.3%
Taylor expanded in y around 0 62.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1.75e+78) (- (+ a z) b) (* z (/ x (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1.75e+78) {
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 (x <= 1.75d+78) 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 (x <= 1.75e+78) {
tmp = (a + z) - b;
} else {
tmp = z * (x / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 1.75e+78: tmp = (a + z) - b else: tmp = z * (x / (t + x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 1.75e+78) 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 (x <= 1.75e+78) tmp = (a + z) - b; else tmp = z * (x / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 1.75e+78], 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}\;x \leq 1.75 \cdot 10^{+78}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x}{t + x}\\
\end{array}
\end{array}
if x < 1.7500000000000001e78Initial program 63.6%
Taylor expanded in y around inf 54.8%
if 1.7500000000000001e78 < x Initial program 50.3%
Taylor expanded in z around inf 29.6%
associate-/l*63.2%
+-commutative63.2%
+-commutative63.2%
associate-+r+63.2%
Simplified63.2%
Taylor expanded in y around 0 62.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1.06e+78) (- (+ a z) b) (* x (/ z (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1.06e+78) {
tmp = (a + z) - b;
} else {
tmp = x * (z / (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 (x <= 1.06d+78) then
tmp = (a + z) - b
else
tmp = x * (z / (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 (x <= 1.06e+78) {
tmp = (a + z) - b;
} else {
tmp = x * (z / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 1.06e+78: tmp = (a + z) - b else: tmp = x * (z / (t + x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 1.06e+78) tmp = Float64(Float64(a + z) - b); else tmp = Float64(x * Float64(z / Float64(t + x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 1.06e+78) tmp = (a + z) - b; else tmp = x * (z / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 1.06e+78], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.06 \cdot 10^{+78}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{t + x}\\
\end{array}
\end{array}
if x < 1.06e78Initial program 63.6%
Taylor expanded in y around inf 54.8%
if 1.06e78 < x Initial program 50.3%
Taylor expanded in z around inf 29.6%
associate-/l*63.2%
+-commutative63.2%
+-commutative63.2%
associate-+r+63.2%
Simplified63.2%
Taylor expanded in y around 0 29.6%
associate-/l*57.7%
Simplified57.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.06e+96) z (if (<= z 7000000000000.0) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.06e+96) {
tmp = z;
} else if (z <= 7000000000000.0) {
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 <= (-2.06d+96)) then
tmp = z
else if (z <= 7000000000000.0d0) 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 <= -2.06e+96) {
tmp = z;
} else if (z <= 7000000000000.0) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.06e+96: tmp = z elif z <= 7000000000000.0: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.06e+96) tmp = z; elseif (z <= 7000000000000.0) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.06e+96) tmp = z; elseif (z <= 7000000000000.0) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.06e+96], z, If[LessEqual[z, 7000000000000.0], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.06 \cdot 10^{+96}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 7000000000000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -2.05999999999999997e96 or 7e12 < z Initial program 44.6%
Taylor expanded in x around inf 53.8%
if -2.05999999999999997e96 < z < 7e12Initial program 74.4%
Taylor expanded in t around inf 36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.9e+78) (- (+ a z) b) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.9e+78) {
tmp = (a + z) - b;
} 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 (x <= 2.9d+78) then
tmp = (a + z) - b
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 (x <= 2.9e+78) {
tmp = (a + z) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.9e+78: tmp = (a + z) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.9e+78) tmp = Float64(Float64(a + z) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 2.9e+78) tmp = (a + z) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.9e+78], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{+78}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < 2.90000000000000017e78Initial program 63.6%
Taylor expanded in y around inf 54.8%
if 2.90000000000000017e78 < x Initial program 50.3%
Taylor expanded in x around inf 54.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x 3.6e+183) (+ a z) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 3.6e+183) {
tmp = a + z;
} 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 (x <= 3.6d+183) then
tmp = a + z
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 (x <= 3.6e+183) {
tmp = a + z;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 3.6e+183: tmp = a + z else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 3.6e+183) tmp = Float64(a + z); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 3.6e+183) tmp = a + z; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 3.6e+183], N[(a + z), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.6 \cdot 10^{+183}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < 3.60000000000000023e183Initial program 62.1%
Taylor expanded in b around 0 44.9%
Taylor expanded in y around inf 49.1%
if 3.60000000000000023e183 < x Initial program 52.7%
Taylor expanded in x around inf 60.2%
(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 61.1%
Taylor expanded in t around inf 27.3%
(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 2024144
(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)))