
(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 (+ x t))) (t_2 (/ y t_1)))
(if (or (<= x -3.5e+124) (not (<= x 1.4e+73)))
(fma (+ (/ x t_1) t_2) z (+ (/ y (/ t_1 (- a b))) (/ (* t a) t_1)))
(+ (/ (- z b) (/ t_1 y)) (fma a (+ t_2 (/ t t_1)) (/ (* x z) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = y / t_1;
double tmp;
if ((x <= -3.5e+124) || !(x <= 1.4e+73)) {
tmp = fma(((x / t_1) + t_2), z, ((y / (t_1 / (a - b))) + ((t * a) / t_1)));
} else {
tmp = ((z - b) / (t_1 / y)) + fma(a, (t_2 + (t / t_1)), ((x * z) / t_1));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(y / t_1) tmp = 0.0 if ((x <= -3.5e+124) || !(x <= 1.4e+73)) tmp = fma(Float64(Float64(x / t_1) + t_2), z, Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(Float64(t * a) / t_1))); else tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + fma(a, Float64(t_2 + Float64(t / t_1)), Float64(Float64(x * z) / t_1))); end return 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[(y / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x, -3.5e+124], N[Not[LessEqual[x, 1.4e+73]], $MachinePrecision]], N[(N[(N[(x / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] * z + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t$95$2 + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{y}{t_1}\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+124} \lor \neg \left(x \leq 1.4 \cdot 10^{+73}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t_1} + t_2, z, \frac{y}{\frac{t_1}{a - b}} + \frac{t \cdot a}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \mathsf{fma}\left(a, t_2 + \frac{t}{t_1}, \frac{x \cdot z}{t_1}\right)\\
\end{array}
\end{array}
if x < -3.5000000000000001e124 or 1.40000000000000004e73 < x Initial program 53.0%
associate--l+53.0%
fma-def53.0%
*-commutative53.0%
distribute-rgt-in53.0%
associate--l+53.0%
fma-def53.0%
distribute-lft-out--53.3%
+-commutative53.3%
Simplified53.3%
Taylor expanded in z around 0 70.2%
fma-def70.2%
associate-/l*95.3%
Simplified95.3%
if -3.5000000000000001e124 < x < 1.40000000000000004e73Initial program 66.0%
Simplified66.3%
Taylor expanded in a around 0 81.0%
associate-/l*97.7%
+-commutative97.7%
fma-def97.7%
Simplified97.7%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ (- z b) (/ t_1 y))))
(if (<= x -2.05e+177)
(+ (/ (* t a) t_1) (+ (/ y (/ t_1 (- a b))) (/ (+ x y) (/ t_1 z))))
(if (<= x 6.4e+62)
(+ t_2 (fma a (+ (/ y t_1) (/ t t_1)) (/ (* x z) t_1)))
(+ t_2 (+ (/ z (/ (+ x t) x)) (/ a (/ (+ x t) t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z - b) / (t_1 / y);
double tmp;
if (x <= -2.05e+177) {
tmp = ((t * a) / t_1) + ((y / (t_1 / (a - b))) + ((x + y) / (t_1 / z)));
} else if (x <= 6.4e+62) {
tmp = t_2 + fma(a, ((y / t_1) + (t / t_1)), ((x * z) / t_1));
} else {
tmp = t_2 + ((z / ((x + t) / x)) + (a / ((x + t) / t)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(z - b) / Float64(t_1 / y)) tmp = 0.0 if (x <= -2.05e+177) tmp = Float64(Float64(Float64(t * a) / t_1) + Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(Float64(x + y) / Float64(t_1 / z)))); elseif (x <= 6.4e+62) tmp = Float64(t_2 + fma(a, Float64(Float64(y / t_1) + Float64(t / t_1)), Float64(Float64(x * z) / t_1))); else tmp = Float64(t_2 + Float64(Float64(z / Float64(Float64(x + t) / x)) + Float64(a / Float64(Float64(x + t) / t)))); end return 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[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e+177], N[(N[(N[(t * a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.4e+62], N[(t$95$2 + N[(a * N[(N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{z - b}{\frac{t_1}{y}}\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+177}:\\
\;\;\;\;\frac{t \cdot a}{t_1} + \left(\frac{y}{\frac{t_1}{a - b}} + \frac{x + y}{\frac{t_1}{z}}\right)\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{+62}:\\
\;\;\;\;t_2 + \mathsf{fma}\left(a, \frac{y}{t_1} + \frac{t}{t_1}, \frac{x \cdot z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 + \left(\frac{z}{\frac{x + t}{x}} + \frac{a}{\frac{x + t}{t}}\right)\\
\end{array}
\end{array}
if x < -2.05000000000000007e177Initial program 47.1%
associate--l+47.1%
fma-def47.1%
*-commutative47.1%
distribute-rgt-in47.1%
associate--l+47.1%
fma-def47.1%
distribute-lft-out--47.8%
+-commutative47.8%
Simplified47.8%
Taylor expanded in z around inf 47.7%
associate-+r+47.7%
*-commutative47.7%
associate-/l*66.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
associate-/l*96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
if -2.05000000000000007e177 < x < 6.39999999999999968e62Initial program 67.5%
Simplified67.8%
Taylor expanded in a around 0 81.2%
associate-/l*97.8%
+-commutative97.8%
fma-def97.8%
Simplified97.8%
if 6.39999999999999968e62 < x Initial program 48.6%
Simplified48.3%
Taylor expanded in a around 0 61.5%
associate-/l*68.9%
+-commutative68.9%
fma-def68.9%
Simplified68.9%
Taylor expanded in y around 0 54.8%
+-commutative54.8%
associate-/l*80.1%
+-commutative80.1%
associate-/l*90.8%
+-commutative90.8%
Simplified90.8%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (* a (+ y t)))
(t_3 (/ (- (+ t_2 (* z (+ x y))) (* y b)) t_1)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 5e+253)))
(+ (/ (- z b) (/ t_1 y)) (+ (/ z (/ (+ x t) x)) (/ a (/ (+ x t) t))))
(- (+ (* (+ (/ x t_1) (/ y t_1)) z) (/ t_2 t_1)) (/ (* y b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a * (y + t);
double t_3 = ((t_2 + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 5e+253)) {
tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t)));
} else {
tmp = ((((x / t_1) + (y / t_1)) * z) + (t_2 / t_1)) - ((y * b) / t_1);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a * (y + t);
double t_3 = ((t_2 + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 5e+253)) {
tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t)));
} else {
tmp = ((((x / t_1) + (y / t_1)) * z) + (t_2 / t_1)) - ((y * b) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a * (y + t) t_3 = ((t_2 + (z * (x + y))) - (y * b)) / t_1 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 5e+253): tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t))) else: tmp = ((((x / t_1) + (y / t_1)) * z) + (t_2 / t_1)) - ((y * b) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a * Float64(y + t)) t_3 = Float64(Float64(Float64(t_2 + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 5e+253)) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(z / Float64(Float64(x + t) / x)) + Float64(a / Float64(Float64(x + t) / t)))); else tmp = Float64(Float64(Float64(Float64(Float64(x / t_1) + Float64(y / t_1)) * z) + Float64(t_2 / t_1)) - Float64(Float64(y * b) / t_1)); 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_3 = ((t_2 + (z * (x + y))) - (y * b)) / t_1; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 5e+253))) tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t))); else tmp = ((((x / t_1) + (y / t_1)) * z) + (t_2 / t_1)) - ((y * b) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 5e+253]], $MachinePrecision]], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] + N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \left(y + t\right)\\
t_3 := \frac{\left(t_2 + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 5 \cdot 10^{+253}\right):\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{z}{\frac{x + t}{x}} + \frac{a}{\frac{x + t}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{x}{t_1} + \frac{y}{t_1}\right) \cdot z + \frac{t_2}{t_1}\right) - \frac{y \cdot b}{t_1}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.9999999999999997e253 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 12.2%
Simplified12.8%
Taylor expanded in a around 0 39.6%
associate-/l*76.3%
+-commutative76.3%
fma-def76.3%
Simplified76.3%
Taylor expanded in y around 0 42.9%
+-commutative42.9%
associate-/l*62.2%
+-commutative62.2%
associate-/l*85.9%
+-commutative85.9%
Simplified85.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.9999999999999997e253Initial program 99.7%
Taylor expanded in z around 0 99.8%
Final simplification93.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+253)))
(+ (/ (- z b) (/ t_1 y)) (+ (/ z (/ (+ x t) x)) (/ a (/ (+ x t) t))))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+253)) {
tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t)));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+253)) {
tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+253): tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+253)) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(z / Float64(Float64(x + t) / x)) + Float64(a / Float64(Float64(x + t) / t)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+253))) tmp = ((z - b) / (t_1 / y)) + ((z / ((x + t) / x)) + (a / ((x + t) / t))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+253]], $MachinePrecision]], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+253}\right):\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{z}{\frac{x + t}{x}} + \frac{a}{\frac{x + t}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\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.9999999999999997e253 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 12.2%
Simplified12.8%
Taylor expanded in a around 0 39.6%
associate-/l*76.3%
+-commutative76.3%
fma-def76.3%
Simplified76.3%
Taylor expanded in y around 0 42.9%
+-commutative42.9%
associate-/l*62.2%
+-commutative62.2%
associate-/l*85.9%
+-commutative85.9%
Simplified85.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.9999999999999997e253Initial program 99.7%
Final simplification93.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) t_1)))
(if (<= t_2 (- INFINITY))
(+ a (/ (- z b) (/ t_1 y)))
(if (<= t_2 5e+286) t_2 (- (+ z a) b)))))
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)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = a + ((z - b) / (t_1 / y));
} else if (t_2 <= 5e+286) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = a + ((z - b) / (t_1 / y));
} else if (t_2 <= 5e+286) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = a + ((z - b) / (t_1 / y)) elif t_2 <= 5e+286: tmp = t_2 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(a + Float64(Float64(z - b) / Float64(t_1 / y))); elseif (t_2 <= 5e+286) tmp = t_2; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = a + ((z - b) / (t_1 / y)); elseif (t_2 <= 5e+286) tmp = t_2; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(a + N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+286], t$95$2, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;a + \frac{z - b}{\frac{t_1}{y}}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+286}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\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.0Initial program 6.7%
Simplified6.5%
Taylor expanded in a around 0 38.3%
associate-/l*74.7%
+-commutative74.7%
fma-def74.7%
Simplified74.7%
Taylor expanded in y around inf 76.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000004e286Initial program 99.7%
if 5.0000000000000004e286 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.6%
associate--l+7.6%
fma-def8.2%
*-commutative8.2%
distribute-rgt-in8.0%
associate--l+8.0%
fma-def8.1%
distribute-lft-out--8.9%
+-commutative8.9%
Simplified8.9%
Taylor expanded in y around inf 76.3%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (+ (* t a) (* x z)) (+ x t)))
(t_3 (+ a (/ (- z b) (/ t_1 y)))))
(if (<= y -8.6e-44)
t_3
(if (<= y 1.35e-161)
t_2
(if (<= y 1.3e-96)
(/ (- (* z (+ x y)) (* y b)) t_1)
(if (<= y 1.4e-48) 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 = ((t * a) + (x * z)) / (x + t);
double t_3 = a + ((z - b) / (t_1 / y));
double tmp;
if (y <= -8.6e-44) {
tmp = t_3;
} else if (y <= 1.35e-161) {
tmp = t_2;
} else if (y <= 1.3e-96) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (y <= 1.4e-48) {
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 = ((t * a) + (x * z)) / (x + t)
t_3 = a + ((z - b) / (t_1 / y))
if (y <= (-8.6d-44)) then
tmp = t_3
else if (y <= 1.35d-161) then
tmp = t_2
else if (y <= 1.3d-96) then
tmp = ((z * (x + y)) - (y * b)) / t_1
else if (y <= 1.4d-48) 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 = ((t * a) + (x * z)) / (x + t);
double t_3 = a + ((z - b) / (t_1 / y));
double tmp;
if (y <= -8.6e-44) {
tmp = t_3;
} else if (y <= 1.35e-161) {
tmp = t_2;
} else if (y <= 1.3e-96) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (y <= 1.4e-48) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((t * a) + (x * z)) / (x + t) t_3 = a + ((z - b) / (t_1 / y)) tmp = 0 if y <= -8.6e-44: tmp = t_3 elif y <= 1.35e-161: tmp = t_2 elif y <= 1.3e-96: tmp = ((z * (x + y)) - (y * b)) / t_1 elif y <= 1.4e-48: 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(Float64(t * a) + Float64(x * z)) / Float64(x + t)) t_3 = Float64(a + Float64(Float64(z - b) / Float64(t_1 / y))) tmp = 0.0 if (y <= -8.6e-44) tmp = t_3; elseif (y <= 1.35e-161) tmp = t_2; elseif (y <= 1.3e-96) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / t_1); elseif (y <= 1.4e-48) 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 = ((t * a) + (x * z)) / (x + t); t_3 = a + ((z - b) / (t_1 / y)); tmp = 0.0; if (y <= -8.6e-44) tmp = t_3; elseif (y <= 1.35e-161) tmp = t_2; elseif (y <= 1.3e-96) tmp = ((z * (x + y)) - (y * b)) / t_1; elseif (y <= 1.4e-48) 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[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a + N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.6e-44], t$95$3, If[LessEqual[y, 1.35e-161], t$95$2, If[LessEqual[y, 1.3e-96], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 1.4e-48], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{t \cdot a + x \cdot z}{x + t}\\
t_3 := a + \frac{z - b}{\frac{t_1}{y}}\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{-44}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-161}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-96}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-48}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -8.60000000000000027e-44 or 1.40000000000000002e-48 < y Initial program 46.5%
Simplified47.0%
Taylor expanded in a around 0 63.1%
associate-/l*91.5%
+-commutative91.5%
fma-def91.5%
Simplified91.5%
Taylor expanded in y around inf 85.3%
if -8.60000000000000027e-44 < y < 1.35e-161 or 1.3000000000000001e-96 < y < 1.40000000000000002e-48Initial program 80.1%
associate--l+80.1%
fma-def80.1%
*-commutative80.1%
distribute-rgt-in80.1%
associate--l+80.1%
fma-def80.1%
distribute-lft-out--80.1%
+-commutative80.1%
Simplified80.1%
Taylor expanded in y around 0 70.8%
if 1.35e-161 < y < 1.3000000000000001e-96Initial program 91.9%
Taylor expanded in a around 0 84.3%
Final simplification79.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* t a) (* x z)) (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -3.3e-37)
t_2
(if (<= y 5.3e-148)
t_1
(if (<= y 1.52e-103)
(* b (/ (- y) (+ x (+ y t))))
(if (<= y 1.2) t_1 (if (<= y 1.22e+27) (/ y (/ (+ x y) a)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x * z)) / (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -3.3e-37) {
tmp = t_2;
} else if (y <= 5.3e-148) {
tmp = t_1;
} else if (y <= 1.52e-103) {
tmp = b * (-y / (x + (y + t)));
} else if (y <= 1.2) {
tmp = t_1;
} else if (y <= 1.22e+27) {
tmp = y / ((x + y) / a);
} 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 = ((t * a) + (x * z)) / (x + t)
t_2 = (z + a) - b
if (y <= (-3.3d-37)) then
tmp = t_2
else if (y <= 5.3d-148) then
tmp = t_1
else if (y <= 1.52d-103) then
tmp = b * (-y / (x + (y + t)))
else if (y <= 1.2d0) then
tmp = t_1
else if (y <= 1.22d+27) then
tmp = y / ((x + y) / a)
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 = ((t * a) + (x * z)) / (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -3.3e-37) {
tmp = t_2;
} else if (y <= 5.3e-148) {
tmp = t_1;
} else if (y <= 1.52e-103) {
tmp = b * (-y / (x + (y + t)));
} else if (y <= 1.2) {
tmp = t_1;
} else if (y <= 1.22e+27) {
tmp = y / ((x + y) / a);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (x * z)) / (x + t) t_2 = (z + a) - b tmp = 0 if y <= -3.3e-37: tmp = t_2 elif y <= 5.3e-148: tmp = t_1 elif y <= 1.52e-103: tmp = b * (-y / (x + (y + t))) elif y <= 1.2: tmp = t_1 elif y <= 1.22e+27: tmp = y / ((x + y) / a) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -3.3e-37) tmp = t_2; elseif (y <= 5.3e-148) tmp = t_1; elseif (y <= 1.52e-103) tmp = Float64(b * Float64(Float64(-y) / Float64(x + Float64(y + t)))); elseif (y <= 1.2) tmp = t_1; elseif (y <= 1.22e+27) tmp = Float64(y / Float64(Float64(x + y) / a)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (x * z)) / (x + t); t_2 = (z + a) - b; tmp = 0.0; if (y <= -3.3e-37) tmp = t_2; elseif (y <= 5.3e-148) tmp = t_1; elseif (y <= 1.52e-103) tmp = b * (-y / (x + (y + t))); elseif (y <= 1.2) tmp = t_1; elseif (y <= 1.22e+27) tmp = y / ((x + y) / a); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.3e-37], t$95$2, If[LessEqual[y, 5.3e-148], t$95$1, If[LessEqual[y, 1.52e-103], N[(b * N[((-y) / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2], t$95$1, If[LessEqual[y, 1.22e+27], N[(y / N[(N[(x + y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot a + x \cdot z}{x + t}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{-37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.52 \cdot 10^{-103}:\\
\;\;\;\;b \cdot \frac{-y}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \leq 1.2:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+27}:\\
\;\;\;\;\frac{y}{\frac{x + y}{a}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.29999999999999982e-37 or 1.2200000000000001e27 < y Initial program 42.1%
associate--l+42.1%
fma-def42.4%
*-commutative42.4%
distribute-rgt-in42.3%
associate--l+42.3%
fma-def42.4%
distribute-lft-out--42.7%
+-commutative42.7%
Simplified42.7%
Taylor expanded in y around inf 72.7%
if -3.29999999999999982e-37 < y < 5.29999999999999995e-148 or 1.52e-103 < y < 1.19999999999999996Initial program 82.1%
associate--l+82.1%
fma-def82.1%
*-commutative82.1%
distribute-rgt-in82.1%
associate--l+82.1%
fma-def82.1%
distribute-lft-out--82.1%
+-commutative82.1%
Simplified82.1%
Taylor expanded in y around 0 69.1%
if 5.29999999999999995e-148 < y < 1.52e-103Initial program 87.8%
associate--l+87.8%
fma-def87.8%
*-commutative87.8%
distribute-rgt-in87.8%
associate--l+87.8%
fma-def87.8%
distribute-lft-out--87.8%
+-commutative87.8%
Simplified87.8%
Taylor expanded in b around inf 63.6%
neg-mul-163.6%
distribute-rgt-neg-in63.6%
Simplified63.6%
expm1-log1p-u35.8%
expm1-udef23.6%
associate-/l*3.5%
+-commutative3.5%
Applied egg-rr3.5%
expm1-def15.8%
expm1-log1p40.6%
associate-/r/63.6%
associate-+l+63.6%
Simplified63.6%
if 1.19999999999999996 < y < 1.2200000000000001e27Initial program 67.9%
associate--l+67.9%
fma-def67.9%
*-commutative67.9%
distribute-rgt-in67.9%
associate--l+67.9%
fma-def67.9%
distribute-lft-out--67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in a around inf 46.5%
Taylor expanded in t around 0 78.1%
*-commutative78.1%
associate-/l*78.3%
+-commutative78.3%
Simplified78.3%
Final simplification71.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.1e-41) (not (<= y 1.9e-148))) (+ a (/ (- z b) (/ (+ y (+ x t)) y))) (/ (+ (* t a) (* x z)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-41) || !(y <= 1.9e-148)) {
tmp = a + ((z - b) / ((y + (x + t)) / y));
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.1d-41)) .or. (.not. (y <= 1.9d-148))) then
tmp = a + ((z - b) / ((y + (x + t)) / y))
else
tmp = ((t * a) + (x * z)) / (x + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-41) || !(y <= 1.9e-148)) {
tmp = a + ((z - b) / ((y + (x + t)) / y));
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.1e-41) or not (y <= 1.9e-148): tmp = a + ((z - b) / ((y + (x + t)) / y)) else: tmp = ((t * a) + (x * z)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.1e-41) || !(y <= 1.9e-148)) tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + Float64(x + t)) / y))); else tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.1e-41) || ~((y <= 1.9e-148))) tmp = a + ((z - b) / ((y + (x + t)) / y)); else tmp = ((t * a) + (x * z)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.1e-41], N[Not[LessEqual[y, 1.9e-148]], $MachinePrecision]], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-41} \lor \neg \left(y \leq 1.9 \cdot 10^{-148}\right):\\
\;\;\;\;a + \frac{z - b}{\frac{y + \left(x + t\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\end{array}
\end{array}
if y < -1.1e-41 or 1.90000000000000007e-148 < y Initial program 50.4%
Simplified50.8%
Taylor expanded in a around 0 65.6%
associate-/l*90.7%
+-commutative90.7%
fma-def90.7%
Simplified90.7%
Taylor expanded in y around inf 81.2%
if -1.1e-41 < y < 1.90000000000000007e-148Initial program 81.7%
associate--l+81.7%
fma-def81.7%
*-commutative81.7%
distribute-rgt-in81.7%
associate--l+81.7%
fma-def81.7%
distribute-lft-out--81.7%
+-commutative81.7%
Simplified81.7%
Taylor expanded in y around 0 71.4%
Final simplification77.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- z b) (/ (+ y t) y))))
(if (<= b -3.15e+153)
t_1
(if (<= b -5.3e+81) z (if (<= b 5.8e+100) (- (+ z a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z - b) / ((y + t) / y);
double tmp;
if (b <= -3.15e+153) {
tmp = t_1;
} else if (b <= -5.3e+81) {
tmp = z;
} else if (b <= 5.8e+100) {
tmp = (z + a) - b;
} 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 - b) / ((y + t) / y)
if (b <= (-3.15d+153)) then
tmp = t_1
else if (b <= (-5.3d+81)) then
tmp = z
else if (b <= 5.8d+100) then
tmp = (z + a) - b
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 - b) / ((y + t) / y);
double tmp;
if (b <= -3.15e+153) {
tmp = t_1;
} else if (b <= -5.3e+81) {
tmp = z;
} else if (b <= 5.8e+100) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z - b) / ((y + t) / y) tmp = 0 if b <= -3.15e+153: tmp = t_1 elif b <= -5.3e+81: tmp = z elif b <= 5.8e+100: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z - b) / Float64(Float64(y + t) / y)) tmp = 0.0 if (b <= -3.15e+153) tmp = t_1; elseif (b <= -5.3e+81) tmp = z; elseif (b <= 5.8e+100) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z - b) / ((y + t) / y); tmp = 0.0; if (b <= -3.15e+153) tmp = t_1; elseif (b <= -5.3e+81) tmp = z; elseif (b <= 5.8e+100) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.15e+153], t$95$1, If[LessEqual[b, -5.3e+81], z, If[LessEqual[b, 5.8e+100], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - b}{\frac{y + t}{y}}\\
\mathbf{if}\;b \leq -3.15 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -5.3 \cdot 10^{+81}:\\
\;\;\;\;z\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+100}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -3.1500000000000001e153 or 5.8000000000000001e100 < b Initial program 55.5%
Simplified56.0%
Taylor expanded in a around 0 59.0%
associate-/l*87.5%
+-commutative87.5%
fma-def87.5%
Simplified87.5%
Taylor expanded in a around 0 73.1%
+-commutative73.1%
Simplified73.1%
Taylor expanded in x around 0 28.4%
associate-/l*52.1%
+-commutative52.1%
Simplified52.1%
if -3.1500000000000001e153 < b < -5.30000000000000028e81Initial program 64.5%
associate--l+64.5%
fma-def64.6%
*-commutative64.6%
distribute-rgt-in64.6%
associate--l+64.6%
fma-def64.6%
distribute-lft-out--64.7%
+-commutative64.7%
Simplified64.7%
Taylor expanded in x around inf 50.6%
if -5.30000000000000028e81 < b < 5.8000000000000001e100Initial program 63.9%
associate--l+63.9%
fma-def64.0%
*-commutative64.0%
distribute-rgt-in63.9%
associate--l+63.9%
fma-def64.0%
distribute-lft-out--64.1%
+-commutative64.1%
Simplified64.1%
Taylor expanded in y around inf 68.9%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.8e+152) (not (<= b 2.4e+131))) (* b (/ (- y) (+ x (+ y t)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.8e+152) || !(b <= 2.4e+131)) {
tmp = b * (-y / (x + (y + 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 ((b <= (-5.8d+152)) .or. (.not. (b <= 2.4d+131))) then
tmp = b * (-y / (x + (y + 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 ((b <= -5.8e+152) || !(b <= 2.4e+131)) {
tmp = b * (-y / (x + (y + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.8e+152) or not (b <= 2.4e+131): tmp = b * (-y / (x + (y + t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.8e+152) || !(b <= 2.4e+131)) tmp = Float64(b * Float64(Float64(-y) / Float64(x + Float64(y + 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 ((b <= -5.8e+152) || ~((b <= 2.4e+131))) tmp = b * (-y / (x + (y + t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.8e+152], N[Not[LessEqual[b, 2.4e+131]], $MachinePrecision]], N[(b * N[((-y) / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.8 \cdot 10^{+152} \lor \neg \left(b \leq 2.4 \cdot 10^{+131}\right):\\
\;\;\;\;b \cdot \frac{-y}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -5.7999999999999997e152 or 2.3999999999999999e131 < b Initial program 55.6%
associate--l+55.6%
fma-def55.8%
*-commutative55.8%
distribute-rgt-in55.8%
associate--l+55.8%
fma-def55.8%
distribute-lft-out--56.1%
+-commutative56.1%
Simplified56.1%
Taylor expanded in b around inf 33.5%
neg-mul-133.5%
distribute-rgt-neg-in33.5%
Simplified33.5%
expm1-log1p-u20.0%
expm1-udef12.5%
associate-/l*22.1%
+-commutative22.1%
Applied egg-rr22.1%
expm1-def29.6%
expm1-log1p59.7%
associate-/r/62.3%
associate-+l+62.3%
Simplified62.3%
if -5.7999999999999997e152 < b < 2.3999999999999999e131Initial program 63.8%
associate--l+63.8%
fma-def64.0%
*-commutative64.0%
distribute-rgt-in63.9%
associate--l+63.9%
fma-def63.9%
distribute-lft-out--64.1%
+-commutative64.1%
Simplified64.1%
Taylor expanded in y around inf 64.5%
Final simplification63.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6.4e+153) (* y (/ (- b) (+ y t))) (if (<= b -5.3e+81) z (- (+ z a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.4e+153) {
tmp = y * (-b / (y + t));
} else if (b <= -5.3e+81) {
tmp = z;
} 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 (b <= (-6.4d+153)) then
tmp = y * (-b / (y + t))
else if (b <= (-5.3d+81)) then
tmp = z
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 (b <= -6.4e+153) {
tmp = y * (-b / (y + t));
} else if (b <= -5.3e+81) {
tmp = z;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6.4e+153: tmp = y * (-b / (y + t)) elif b <= -5.3e+81: tmp = z else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.4e+153) tmp = Float64(y * Float64(Float64(-b) / Float64(y + t))); elseif (b <= -5.3e+81) tmp = z; 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 (b <= -6.4e+153) tmp = y * (-b / (y + t)); elseif (b <= -5.3e+81) tmp = z; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.4e+153], N[(y * N[((-b) / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5.3e+81], z, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{+153}:\\
\;\;\;\;y \cdot \frac{-b}{y + t}\\
\mathbf{elif}\;b \leq -5.3 \cdot 10^{+81}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -6.4000000000000003e153Initial program 55.7%
Simplified56.3%
Taylor expanded in a around 0 59.6%
associate-/l*93.0%
+-commutative93.0%
fma-def93.0%
Simplified93.0%
Taylor expanded in a around 0 75.9%
+-commutative75.9%
Simplified75.9%
Taylor expanded in x around 0 29.7%
associate-/l*53.1%
+-commutative53.1%
Simplified53.1%
Taylor expanded in z around 0 29.7%
mul-1-neg29.7%
*-commutative29.7%
+-commutative29.7%
associate-*l/49.9%
distribute-rgt-neg-in49.9%
Simplified49.9%
if -6.4000000000000003e153 < b < -5.30000000000000028e81Initial program 64.5%
associate--l+64.5%
fma-def64.6%
*-commutative64.6%
distribute-rgt-in64.6%
associate--l+64.6%
fma-def64.6%
distribute-lft-out--64.7%
+-commutative64.7%
Simplified64.7%
Taylor expanded in x around inf 50.6%
if -5.30000000000000028e81 < b Initial program 62.3%
associate--l+62.3%
fma-def62.4%
*-commutative62.4%
distribute-rgt-in62.3%
associate--l+62.3%
fma-def62.3%
distribute-lft-out--62.5%
+-commutative62.5%
Simplified62.5%
Taylor expanded in y around inf 63.2%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.3e+154) (/ (- y) (/ (+ y t) b)) (if (<= b -5.3e+81) z (- (+ z a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.3e+154) {
tmp = -y / ((y + t) / b);
} else if (b <= -5.3e+81) {
tmp = z;
} 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 (b <= (-4.3d+154)) then
tmp = -y / ((y + t) / b)
else if (b <= (-5.3d+81)) then
tmp = z
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 (b <= -4.3e+154) {
tmp = -y / ((y + t) / b);
} else if (b <= -5.3e+81) {
tmp = z;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.3e+154: tmp = -y / ((y + t) / b) elif b <= -5.3e+81: tmp = z else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.3e+154) tmp = Float64(Float64(-y) / Float64(Float64(y + t) / b)); elseif (b <= -5.3e+81) tmp = z; 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 (b <= -4.3e+154) tmp = -y / ((y + t) / b); elseif (b <= -5.3e+81) tmp = z; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.3e+154], N[((-y) / N[(N[(y + t), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5.3e+81], z, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.3 \cdot 10^{+154}:\\
\;\;\;\;\frac{-y}{\frac{y + t}{b}}\\
\mathbf{elif}\;b \leq -5.3 \cdot 10^{+81}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -4.2999999999999998e154Initial program 55.7%
associate--l+55.7%
fma-def56.3%
*-commutative56.3%
distribute-rgt-in56.3%
associate--l+56.3%
fma-def56.3%
distribute-lft-out--56.3%
+-commutative56.3%
Simplified56.3%
Taylor expanded in b around inf 39.1%
neg-mul-139.1%
distribute-rgt-neg-in39.1%
Simplified39.1%
Taylor expanded in x around 0 29.7%
mul-1-neg29.7%
associate-/l*50.0%
distribute-neg-frac50.0%
+-commutative50.0%
Simplified50.0%
if -4.2999999999999998e154 < b < -5.30000000000000028e81Initial program 64.5%
associate--l+64.5%
fma-def64.6%
*-commutative64.6%
distribute-rgt-in64.6%
associate--l+64.6%
fma-def64.6%
distribute-lft-out--64.7%
+-commutative64.7%
Simplified64.7%
Taylor expanded in x around inf 50.6%
if -5.30000000000000028e81 < b Initial program 62.3%
associate--l+62.3%
fma-def62.4%
*-commutative62.4%
distribute-rgt-in62.3%
associate--l+62.3%
fma-def62.3%
distribute-lft-out--62.5%
+-commutative62.5%
Simplified62.5%
Taylor expanded in y around inf 63.2%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.02e+66) a (if (<= a 6.2e-44) (- z b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.02e+66) {
tmp = a;
} else if (a <= 6.2e-44) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.02d+66)) then
tmp = a
else if (a <= 6.2d-44) then
tmp = z - b
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.02e+66) {
tmp = a;
} else if (a <= 6.2e-44) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.02e+66: tmp = a elif a <= 6.2e-44: tmp = z - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.02e+66) tmp = a; elseif (a <= 6.2e-44) tmp = Float64(z - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.02e+66) tmp = a; elseif (a <= 6.2e-44) tmp = z - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.02e+66], a, If[LessEqual[a, 6.2e-44], N[(z - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{+66}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-44}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.01999999999999998e66 or 6.19999999999999968e-44 < a Initial program 49.9%
associate--l+49.9%
fma-def50.1%
*-commutative50.1%
distribute-rgt-in50.0%
associate--l+50.0%
fma-def50.0%
distribute-lft-out--50.4%
+-commutative50.4%
Simplified50.4%
Taylor expanded in t around inf 50.2%
if -1.01999999999999998e66 < a < 6.19999999999999968e-44Initial program 72.8%
Simplified73.0%
Taylor expanded in a around 0 73.7%
associate-/l*90.9%
+-commutative90.9%
fma-def90.9%
Simplified90.9%
Taylor expanded in a around 0 76.0%
+-commutative76.0%
Simplified76.0%
Taylor expanded in y around inf 49.6%
Final simplification49.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x 4.6e+148) (- (+ z a) b) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 4.6e+148) {
tmp = (z + a) - 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 <= 4.6d+148) then
tmp = (z + a) - 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 <= 4.6e+148) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 4.6e+148: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 4.6e+148) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 4.6e+148) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 4.6e+148], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.6 \cdot 10^{+148}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < 4.6000000000000001e148Initial program 64.0%
associate--l+64.0%
fma-def64.1%
*-commutative64.1%
distribute-rgt-in64.1%
associate--l+64.1%
fma-def64.1%
distribute-lft-out--64.4%
+-commutative64.4%
Simplified64.4%
Taylor expanded in y around inf 59.5%
if 4.6000000000000001e148 < x Initial program 42.2%
associate--l+42.2%
fma-def42.2%
*-commutative42.2%
distribute-rgt-in42.0%
associate--l+42.0%
fma-def42.0%
distribute-lft-out--42.0%
+-commutative42.0%
Simplified42.0%
Taylor expanded in x around inf 67.9%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.5e-71) z (if (<= z 3.2e+62) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.5e-71) {
tmp = z;
} else if (z <= 3.2e+62) {
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.5d-71)) then
tmp = z
else if (z <= 3.2d+62) 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.5e-71) {
tmp = z;
} else if (z <= 3.2e+62) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.5e-71: tmp = z elif z <= 3.2e+62: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.5e-71) tmp = z; elseif (z <= 3.2e+62) 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.5e-71) tmp = z; elseif (z <= 3.2e+62) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.5e-71], z, If[LessEqual[z, 3.2e+62], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-71}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+62}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -2.49999999999999999e-71 or 3.19999999999999984e62 < z Initial program 50.7%
associate--l+50.7%
fma-def51.0%
*-commutative51.0%
distribute-rgt-in50.9%
associate--l+50.9%
fma-def51.0%
distribute-lft-out--51.2%
+-commutative51.2%
Simplified51.2%
Taylor expanded in x around inf 54.7%
if -2.49999999999999999e-71 < z < 3.19999999999999984e62Initial program 72.2%
associate--l+72.2%
fma-def72.2%
*-commutative72.2%
distribute-rgt-in72.2%
associate--l+72.2%
fma-def72.2%
distribute-lft-out--72.3%
+-commutative72.3%
Simplified72.3%
Taylor expanded in t around inf 42.9%
Final simplification48.6%
(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.8%
associate--l+61.8%
fma-def61.9%
*-commutative61.9%
distribute-rgt-in61.9%
associate--l+61.9%
fma-def61.9%
distribute-lft-out--62.1%
+-commutative62.1%
Simplified62.1%
Taylor expanded in t around inf 32.1%
Final simplification32.1%
(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 2023207
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(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)))