
(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 14 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) (+ y t)))
(t_2 (/ z (+ y t)))
(t_3 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t))))
(t_4 (* (+ x y) (+ x y))))
(if (<= t_3 (- INFINITY))
(-
(fma
t
(- (fma y (/ b t_4) (/ a (+ x y))) (fma a (/ y t_4) (/ z (+ x y))))
(fma a (/ y (+ x y)) z))
(* y (/ b (+ x y))))
(if (<= t_3 5e+266)
t_3
(-
(fma
x
(- (fma y (/ b t_1) t_2) (fma y (/ z t_1) (/ a (+ y t))))
(fma y t_2 a))
(* y (/ b (+ y t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * (y + t);
double t_2 = z / (y + t);
double t_3 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double t_4 = (x + y) * (x + y);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma(t, (fma(y, (b / t_4), (a / (x + y))) - fma(a, (y / t_4), (z / (x + y)))), fma(a, (y / (x + y)), z)) - (y * (b / (x + y)));
} else if (t_3 <= 5e+266) {
tmp = t_3;
} else {
tmp = fma(x, (fma(y, (b / t_1), t_2) - fma(y, (z / t_1), (a / (y + t)))), fma(y, t_2, a)) - (y * (b / (y + t)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) * Float64(y + t)) t_2 = Float64(z / Float64(y + t)) t_3 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) t_4 = Float64(Float64(x + y) * Float64(x + y)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(fma(t, Float64(fma(y, Float64(b / t_4), Float64(a / Float64(x + y))) - fma(a, Float64(y / t_4), Float64(z / Float64(x + y)))), fma(a, Float64(y / Float64(x + y)), z)) - Float64(y * Float64(b / Float64(x + y)))); elseif (t_3 <= 5e+266) tmp = t_3; else tmp = Float64(fma(x, Float64(fma(y, Float64(b / t_1), t_2) - fma(y, Float64(z / t_1), Float64(a / Float64(y + t)))), fma(y, t_2, a)) - Float64(y * Float64(b / Float64(y + t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(t * N[(N[(y * N[(b / t$95$4), $MachinePrecision] + N[(a / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t$95$4), $MachinePrecision] + N[(z / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+266], t$95$3, N[(N[(x * N[(N[(y * N[(b / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(y * N[(z / t$95$1), $MachinePrecision] + N[(a / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * t$95$2 + a), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot \left(y + t\right)\\
t_2 := \frac{z}{y + t}\\
t_3 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
t_4 := \left(x + y\right) \cdot \left(x + y\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t\_4}, \frac{a}{x + y}\right) - \mathsf{fma}\left(a, \frac{y}{t\_4}, \frac{z}{x + y}\right), \mathsf{fma}\left(a, \frac{y}{x + y}, z\right)\right) - y \cdot \frac{b}{x + y}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+266}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, \frac{b}{t\_1}, t\_2\right) - \mathsf{fma}\left(y, \frac{z}{t\_1}, \frac{a}{y + t}\right), \mathsf{fma}\left(y, t\_2, a\right)\right) - y \cdot \frac{b}{y + t}\\
\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.4%
Taylor expanded in t around 0
lower--.f64N/A
Simplified77.8%
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.9999999999999999e266Initial program 99.7%
if 4.9999999999999999e266 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.7%
Taylor expanded in x around 0
lower--.f64N/A
Simplified78.5%
Final simplification90.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t))))
(t_2 (* (+ x y) (+ x y))))
(if (<= t_1 (- INFINITY))
(-
(fma
t
(- (fma y (/ b t_2) (/ a (+ x y))) (fma a (/ y t_2) (/ z (+ x y))))
(fma a (/ y (+ x y)) z))
(* y (/ b (+ x y))))
(if (<= t_1 5e+248) t_1 (+ a (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double t_2 = (x + y) * (x + y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(t, (fma(y, (b / t_2), (a / (x + y))) - fma(a, (y / t_2), (z / (x + y)))), fma(a, (y / (x + y)), z)) - (y * (b / (x + y)));
} else if (t_1 <= 5e+248) {
tmp = t_1;
} else {
tmp = a + (z - b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(Float64(x + y) * Float64(x + y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(t, Float64(fma(y, Float64(b / t_2), Float64(a / Float64(x + y))) - fma(a, Float64(y / t_2), Float64(z / Float64(x + y)))), fma(a, Float64(y / Float64(x + y)), z)) - Float64(y * Float64(b / Float64(x + y)))); elseif (t_1 <= 5e+248) tmp = t_1; else tmp = Float64(a + Float64(z - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(t * N[(N[(y * N[(b / t$95$2), $MachinePrecision] + N[(a / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t$95$2), $MachinePrecision] + N[(z / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+248], t$95$1, N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := \left(x + y\right) \cdot \left(x + y\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t\_2}, \frac{a}{x + y}\right) - \mathsf{fma}\left(a, \frac{y}{t\_2}, \frac{z}{x + y}\right), \mathsf{fma}\left(a, \frac{y}{x + y}, z\right)\right) - y \cdot \frac{b}{x + y}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a + \left(z - b\right)\\
\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.4%
Taylor expanded in t around 0
lower--.f64N/A
Simplified77.8%
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.9999999999999996e248Initial program 99.7%
if 4.9999999999999996e248 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.2%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6470.6
Simplified70.6%
Final simplification88.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t))))
(t_2 (+ a (- z b))))
(if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 5e+248) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double t_2 = a + (z - b);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 5e+248) {
tmp = t_1;
} 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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double t_2 = a + (z - b);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 5e+248) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t)) t_2 = a + (z - b) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 5e+248: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(a + Float64(z - b)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 5e+248) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t)); t_2 = a + (z - b); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 5e+248) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 5e+248], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := a + \left(z - b\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\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.9999999999999996e248 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.4%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6472.3
Simplified72.3%
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.9999999999999996e248Initial program 99.7%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (fma x (/ z t) a) (* a (/ x t)))))
(if (<= t -1.7e+224)
t_1
(if (<= t 1.02e-247)
(+ a (- z b))
(if (<= t 7e-64)
(- z (/ (fma (+ y t) z (- (fma y (- z b) (* (+ y t) a)))) x))
(if (<= t 1.32e+221) (+ z a) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(x, (z / t), a) - (a * (x / t));
double tmp;
if (t <= -1.7e+224) {
tmp = t_1;
} else if (t <= 1.02e-247) {
tmp = a + (z - b);
} else if (t <= 7e-64) {
tmp = z - (fma((y + t), z, -fma(y, (z - b), ((y + t) * a))) / x);
} else if (t <= 1.32e+221) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(x, Float64(z / t), a) - Float64(a * Float64(x / t))) tmp = 0.0 if (t <= -1.7e+224) tmp = t_1; elseif (t <= 1.02e-247) tmp = Float64(a + Float64(z - b)); elseif (t <= 7e-64) tmp = Float64(z - Float64(fma(Float64(y + t), z, Float64(-fma(y, Float64(z - b), Float64(Float64(y + t) * a)))) / x)); elseif (t <= 1.32e+221) tmp = Float64(z + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[(z / t), $MachinePrecision] + a), $MachinePrecision] - N[(a * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+224], t$95$1, If[LessEqual[t, 1.02e-247], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-64], N[(z - N[(N[(N[(y + t), $MachinePrecision] * z + (-N[(y * N[(z - b), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.32e+221], N[(z + a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{z}{t}, a\right) - a \cdot \frac{x}{t}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-247}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-64}:\\
\;\;\;\;z - \frac{\mathsf{fma}\left(y + t, z, -\mathsf{fma}\left(y, z - b, \left(y + t\right) \cdot a\right)\right)}{x}\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{+221}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7000000000000001e224 or 1.32000000000000009e221 < t Initial program 45.1%
Taylor expanded in t around inf
lower--.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.7
Simplified82.7%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6474.4
Simplified74.4%
if -1.7000000000000001e224 < t < 1.01999999999999994e-247Initial program 60.0%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6465.9
Simplified65.9%
if 1.01999999999999994e-247 < t < 7.0000000000000006e-64Initial program 87.6%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Simplified75.5%
if 7.0000000000000006e-64 < t < 1.32000000000000009e221Initial program 62.4%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6470.8
Simplified70.8%
Taylor expanded in b around 0
lower-+.f6472.9
Simplified72.9%
Final simplification70.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (/ y (- (- (- y) x) t))))) (if (<= b -3e+133) t_1 (if (<= b 1.5e+135) (+ z a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y / ((-y - x) - t));
double tmp;
if (b <= -3e+133) {
tmp = t_1;
} else if (b <= 1.5e+135) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (y / ((-y - x) - t))
if (b <= (-3d+133)) then
tmp = t_1
else if (b <= 1.5d+135) then
tmp = z + a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y / ((-y - x) - t));
double tmp;
if (b <= -3e+133) {
tmp = t_1;
} else if (b <= 1.5e+135) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (y / ((-y - x) - t)) tmp = 0 if b <= -3e+133: tmp = t_1 elif b <= 1.5e+135: tmp = z + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(y / Float64(Float64(Float64(-y) - x) - t))) tmp = 0.0 if (b <= -3e+133) tmp = t_1; elseif (b <= 1.5e+135) tmp = Float64(z + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (y / ((-y - x) - t)); tmp = 0.0; if (b <= -3e+133) tmp = t_1; elseif (b <= 1.5e+135) tmp = z + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y / N[(N[((-y) - x), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e+133], t$95$1, If[LessEqual[b, 1.5e+135], N[(z + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \frac{y}{\left(\left(-y\right) - x\right) - t}\\
\mathbf{if}\;b \leq -3 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+135}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.00000000000000007e133 or 1.5e135 < b Initial program 52.1%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified47.5%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Simplified39.4%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
Simplified76.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f6460.6
Simplified60.6%
if -3.00000000000000007e133 < b < 1.5e135Initial program 64.8%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6468.1
Simplified68.1%
Taylor expanded in b around 0
lower-+.f6469.5
Simplified69.5%
Final simplification67.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.8e+132) (+ z (/ (* y (- a b)) x)) (if (<= x 1.68e+124) (+ a (- z b)) (- z (/ (* y b) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.8e+132) {
tmp = z + ((y * (a - b)) / x);
} else if (x <= 1.68e+124) {
tmp = a + (z - b);
} else {
tmp = z - ((y * b) / x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-3.8d+132)) then
tmp = z + ((y * (a - b)) / x)
else if (x <= 1.68d+124) then
tmp = a + (z - b)
else
tmp = z - ((y * b) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.8e+132) {
tmp = z + ((y * (a - b)) / x);
} else if (x <= 1.68e+124) {
tmp = a + (z - b);
} else {
tmp = z - ((y * b) / x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.8e+132: tmp = z + ((y * (a - b)) / x) elif x <= 1.68e+124: tmp = a + (z - b) else: tmp = z - ((y * b) / x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.8e+132) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / x)); elseif (x <= 1.68e+124) tmp = Float64(a + Float64(z - b)); else tmp = Float64(z - Float64(Float64(y * b) / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.8e+132) tmp = z + ((y * (a - b)) / x); elseif (x <= 1.68e+124) tmp = a + (z - b); else tmp = z - ((y * b) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.8e+132], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.68e+124], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], N[(z - N[(N[(y * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+132}:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x}\\
\mathbf{elif}\;x \leq 1.68 \cdot 10^{+124}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z - \frac{y \cdot b}{x}\\
\end{array}
\end{array}
if x < -3.80000000000000006e132Initial program 51.3%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Simplified65.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6465.4
Simplified65.4%
if -3.80000000000000006e132 < x < 1.67999999999999995e124Initial program 66.5%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6468.6
Simplified68.6%
if 1.67999999999999995e124 < x Initial program 49.1%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Simplified53.0%
Taylor expanded in b around inf
lower-*.f6458.6
Simplified58.6%
Final simplification66.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- z (/ (* y b) x)))) (if (<= x -2.6e+131) t_1 (if (<= x 1.68e+124) (+ a (- z b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z - ((y * b) / x);
double tmp;
if (x <= -2.6e+131) {
tmp = t_1;
} else if (x <= 1.68e+124) {
tmp = a + (z - 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 - ((y * b) / x)
if (x <= (-2.6d+131)) then
tmp = t_1
else if (x <= 1.68d+124) then
tmp = a + (z - 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 - ((y * b) / x);
double tmp;
if (x <= -2.6e+131) {
tmp = t_1;
} else if (x <= 1.68e+124) {
tmp = a + (z - b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z - ((y * b) / x) tmp = 0 if x <= -2.6e+131: tmp = t_1 elif x <= 1.68e+124: tmp = a + (z - b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z - Float64(Float64(y * b) / x)) tmp = 0.0 if (x <= -2.6e+131) tmp = t_1; elseif (x <= 1.68e+124) tmp = Float64(a + Float64(z - b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z - ((y * b) / x); tmp = 0.0; if (x <= -2.6e+131) tmp = t_1; elseif (x <= 1.68e+124) 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[(z - N[(N[(y * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e+131], t$95$1, If[LessEqual[x, 1.68e+124], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z - \frac{y \cdot b}{x}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.68 \cdot 10^{+124}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.6e131 or 1.67999999999999995e124 < x Initial program 50.2%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Simplified59.2%
Taylor expanded in b around inf
lower-*.f6458.7
Simplified58.7%
if -2.6e131 < x < 1.67999999999999995e124Initial program 66.5%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6468.6
Simplified68.6%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.05e+165) (* z (- 1.0 (/ t x))) (if (<= x 5.2e+124) (+ a (- z b)) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.05e+165) {
tmp = z * (1.0 - (t / x));
} else if (x <= 5.2e+124) {
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.05d+165)) then
tmp = z * (1.0d0 - (t / x))
else if (x <= 5.2d+124) 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.05e+165) {
tmp = z * (1.0 - (t / x));
} else if (x <= 5.2e+124) {
tmp = a + (z - b);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.05e+165: tmp = z * (1.0 - (t / x)) elif x <= 5.2e+124: tmp = a + (z - b) else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.05e+165) tmp = Float64(z * Float64(1.0 - Float64(t / x))); elseif (x <= 5.2e+124) tmp = Float64(a + Float64(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.05e+165) tmp = z * (1.0 - (t / x)); elseif (x <= 5.2e+124) tmp = a + (z - b); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.05e+165], N[(z * N[(1.0 - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+124], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+165}:\\
\;\;\;\;z \cdot \left(1 - \frac{t}{x}\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+124}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.0500000000000001e165Initial program 48.1%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Simplified66.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6455.0
Simplified55.0%
if -2.0500000000000001e165 < x < 5.2000000000000001e124Initial program 66.2%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6467.2
Simplified67.2%
if 5.2000000000000001e124 < x Initial program 49.1%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified74.0%
Taylor expanded in x around inf
Simplified54.3%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.05e+165) z (if (<= x 5.2e+124) (+ a (- z b)) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.05e+165) {
tmp = z;
} else if (x <= 5.2e+124) {
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.05d+165)) then
tmp = z
else if (x <= 5.2d+124) 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.05e+165) {
tmp = z;
} else if (x <= 5.2e+124) {
tmp = a + (z - b);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.05e+165: tmp = z elif x <= 5.2e+124: tmp = a + (z - b) else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.05e+165) tmp = z; elseif (x <= 5.2e+124) tmp = Float64(a + Float64(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.05e+165) tmp = z; elseif (x <= 5.2e+124) tmp = a + (z - b); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.05e+165], z, If[LessEqual[x, 5.2e+124], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+165}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+124}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.0500000000000001e165 or 5.2000000000000001e124 < x Initial program 48.7%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified76.3%
Taylor expanded in x around inf
Simplified54.6%
if -2.0500000000000001e165 < x < 5.2000000000000001e124Initial program 66.2%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6467.2
Simplified67.2%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.2e+237) a (if (<= t 9.5e-251) (+ a (- z b)) (+ z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.2e+237) {
tmp = a;
} else if (t <= 9.5e-251) {
tmp = a + (z - b);
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-4.2d+237)) then
tmp = a
else if (t <= 9.5d-251) then
tmp = a + (z - b)
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.2e+237) {
tmp = a;
} else if (t <= 9.5e-251) {
tmp = a + (z - b);
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.2e+237: tmp = a elif t <= 9.5e-251: tmp = a + (z - b) else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.2e+237) tmp = a; elseif (t <= 9.5e-251) tmp = Float64(a + Float64(z - b)); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4.2e+237) tmp = a; elseif (t <= 9.5e-251) tmp = a + (z - b); else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.2e+237], a, If[LessEqual[t, 9.5e-251], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], N[(z + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+237}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-251}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if t < -4.20000000000000029e237Initial program 43.7%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified46.9%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Simplified91.0%
Taylor expanded in t around inf
Simplified73.6%
if -4.20000000000000029e237 < t < 9.49999999999999927e-251Initial program 59.0%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6463.5
Simplified63.5%
if 9.49999999999999927e-251 < t Initial program 67.1%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6456.2
Simplified56.2%
Taylor expanded in b around 0
lower-+.f6461.4
Simplified61.4%
Final simplification63.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t 9.5e-251) (+ a (- z b)) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 9.5e-251) {
tmp = a + (z - b);
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= 9.5d-251) then
tmp = a + (z - b)
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 9.5e-251) {
tmp = a + (z - b);
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= 9.5e-251: tmp = a + (z - b) else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 9.5e-251) tmp = Float64(a + Float64(z - b)); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= 9.5e-251) tmp = a + (z - b); else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 9.5e-251], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.5 \cdot 10^{-251}:\\
\;\;\;\;a + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if t < 9.49999999999999927e-251Initial program 56.7%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6461.2
Simplified61.2%
if 9.49999999999999927e-251 < t Initial program 67.1%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6456.2
Simplified56.2%
Taylor expanded in b around 0
lower-+.f6461.4
Simplified61.4%
Final simplification61.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b 5.8e+135) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5.8e+135) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 5.8d+135) then
tmp = z + a
else
tmp = a - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5.8e+135) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 5.8e+135: tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 5.8e+135) tmp = Float64(z + a); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 5.8e+135) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 5.8e+135], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.8 \cdot 10^{+135}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if b < 5.7999999999999997e135Initial program 62.6%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6462.2
Simplified62.2%
Taylor expanded in b around 0
lower-+.f6462.1
Simplified62.1%
if 5.7999999999999997e135 < b Initial program 53.4%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6442.1
Simplified42.1%
Taylor expanded in z around 0
lower--.f6440.7
Simplified40.7%
Final simplification58.8%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 61.2%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6459.0
Simplified59.0%
Taylor expanded in b around 0
lower-+.f6456.3
Simplified56.3%
Final simplification56.3%
(FPCore (x y z t a b) :precision binary64 (- b))
double code(double x, double y, double z, double t, double a, double b) {
return -b;
}
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 = -b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -b;
}
def code(x, y, z, t, a, b): return -b
function code(x, y, z, t, a, b) return Float64(-b) end
function tmp = code(x, y, z, t, a, b) tmp = -b; end
code[x_, y_, z_, t_, a_, b_] := (-b)
\begin{array}{l}
\\
-b
\end{array}
Initial program 61.2%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6459.0
Simplified59.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6410.7
Simplified10.7%
(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 2024207
(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)))