
(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 (+ x t)))
(t_2 (- (+ z a) b))
(t_3 (* (+ x y) z))
(t_4 (/ (- (+ t_3 (* a (+ y t))) (* y b)) t_1)))
(if (<= t_4 (- INFINITY))
t_2
(if (<= t_4 1e+286)
(/ (- (+ t_3 (+ (* y a) (* t a))) (* y b)) t_1)
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 = (z + a) - b;
double t_3 = (x + y) * z;
double t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_4 <= 1e+286) {
tmp = ((t_3 + ((y * a) + (t * a))) - (y * b)) / 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 = y + (x + t);
double t_2 = (z + a) - b;
double t_3 = (x + y) * z;
double t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_4 <= 1e+286) {
tmp = ((t_3 + ((y * a) + (t * a))) - (y * b)) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b t_3 = (x + y) * z t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if t_4 <= -math.inf: tmp = t_2 elif t_4 <= 1e+286: tmp = ((t_3 + ((y * a) + (t * a))) - (y * b)) / t_1 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(z + a) - b) t_3 = Float64(Float64(x + y) * z) t_4 = Float64(Float64(Float64(t_3 + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_2; elseif (t_4 <= 1e+286) tmp = Float64(Float64(Float64(t_3 + Float64(Float64(y * a) + Float64(t * a))) - Float64(y * b)) / t_1); 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 = (z + a) - b; t_3 = (x + y) * z; t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if (t_4 <= -Inf) tmp = t_2; elseif (t_4 <= 1e+286) tmp = ((t_3 + ((y * a) + (t * a))) - (y * b)) / t_1; 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[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$2, If[LessEqual[t$95$4, 1e+286], N[(N[(N[(t$95$3 + N[(N[(y * a), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
t_3 := \left(x + y\right) \cdot z\\
t_4 := \frac{\left(t\_3 + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 10^{+286}:\\
\;\;\;\;\frac{\left(t\_3 + \left(y \cdot a + t \cdot a\right)\right) - y \cdot b}{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 1.00000000000000003e286 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.7%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6474.4%
Simplified74.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000003e286Initial program 99.8%
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.8%
Applied egg-rr99.8%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) (+ y (+ x t))))
(t_2 (- (+ z a) b)))
(if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 1e+286) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 1e+286) {
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 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 1e+286) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)) t_2 = (z + a) - b tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 1e+286: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 1e+286) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)); t_2 = (z + a) - b; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 1e+286) 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 1e+286], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+286}:\\
\;\;\;\;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 1.00000000000000003e286 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.7%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6474.4%
Simplified74.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000003e286Initial program 99.8%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.4e-87)
t_1
(if (<= y 1.15e-146)
(* z (+ (/ x (+ x t)) (/ (* t a) (* z (+ x t)))))
(if (<= y 1.15e+109)
(* (/ 1.0 (+ x (+ y t))) (+ (* x z) (* y (- z b))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.4e-87) {
tmp = t_1;
} else if (y <= 1.15e-146) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else if (y <= 1.15e+109) {
tmp = (1.0 / (x + (y + t))) * ((x * z) + (y * (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 + a) - b
if (y <= (-2.4d-87)) then
tmp = t_1
else if (y <= 1.15d-146) then
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))))
else if (y <= 1.15d+109) then
tmp = (1.0d0 / (x + (y + t))) * ((x * z) + (y * (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 + a) - b;
double tmp;
if (y <= -2.4e-87) {
tmp = t_1;
} else if (y <= 1.15e-146) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else if (y <= 1.15e+109) {
tmp = (1.0 / (x + (y + t))) * ((x * z) + (y * (z - b)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.4e-87: tmp = t_1 elif y <= 1.15e-146: tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))) elif y <= 1.15e+109: tmp = (1.0 / (x + (y + t))) * ((x * z) + (y * (z - b))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.4e-87) tmp = t_1; elseif (y <= 1.15e-146) tmp = Float64(z * Float64(Float64(x / Float64(x + t)) + Float64(Float64(t * a) / Float64(z * Float64(x + t))))); elseif (y <= 1.15e+109) tmp = Float64(Float64(1.0 / Float64(x + Float64(y + t))) * Float64(Float64(x * z) + Float64(y * Float64(z - b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -2.4e-87) tmp = t_1; elseif (y <= 1.15e-146) tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))); elseif (y <= 1.15e+109) tmp = (1.0 / (x + (y + t))) * ((x * z) + (y * (z - b))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.4e-87], t$95$1, If[LessEqual[y, 1.15e-146], N[(z * N[(N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] / N[(z * N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+109], N[(N[(1.0 / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x * z), $MachinePrecision] + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-146}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{t \cdot a}{z \cdot \left(x + t\right)}\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+109}:\\
\;\;\;\;\frac{1}{x + \left(y + t\right)} \cdot \left(x \cdot z + y \cdot \left(z - b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4e-87 or 1.15000000000000005e109 < y Initial program 42.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6472.2%
Simplified72.2%
if -2.4e-87 < y < 1.15e-146Initial program 77.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6462.4%
Simplified62.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6471.5%
Simplified71.5%
if 1.15e-146 < y < 1.15000000000000005e109Initial program 78.9%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6478.8%
Applied egg-rr78.8%
Taylor expanded in a around 0
distribute-rgt-inN/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
distribute-lft-inN/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6460.1%
Simplified60.1%
Final simplification69.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.65e-87)
t_1
(if (<= y 1.25e-21)
(* z (+ (/ x (+ x t)) (/ (* t a) (* z (+ x t)))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.65e-87) {
tmp = t_1;
} else if (y <= 1.25e-21) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.65d-87)) then
tmp = t_1
else if (y <= 1.25d-21) then
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.65e-87) {
tmp = t_1;
} else if (y <= 1.25e-21) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.65e-87: tmp = t_1 elif y <= 1.25e-21: tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.65e-87) tmp = t_1; elseif (y <= 1.25e-21) tmp = Float64(z * Float64(Float64(x / Float64(x + t)) + Float64(Float64(t * a) / Float64(z * Float64(x + t))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.65e-87) tmp = t_1; elseif (y <= 1.25e-21) tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.65e-87], t$95$1, If[LessEqual[y, 1.25e-21], N[(z * N[(N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] / N[(z * N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-21}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{t \cdot a}{z \cdot \left(x + t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.65e-87 or 1.24999999999999993e-21 < y Initial program 47.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6469.0%
Simplified69.0%
if -1.65e-87 < y < 1.24999999999999993e-21Initial program 79.3%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6458.0%
Simplified58.0%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6466.1%
Simplified66.1%
Final simplification67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -5e-146)
t_1
(if (<= y 3.2e-21) (/ (+ (* t a) (* x z)) (+ x t)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -5e-146) {
tmp = t_1;
} else if (y <= 3.2e-21) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-5d-146)) then
tmp = t_1
else if (y <= 3.2d-21) then
tmp = ((t * a) + (x * z)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -5e-146) {
tmp = t_1;
} else if (y <= 3.2e-21) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -5e-146: tmp = t_1 elif y <= 3.2e-21: tmp = ((t * a) + (x * z)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -5e-146) tmp = t_1; elseif (y <= 3.2e-21) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -5e-146) tmp = t_1; elseif (y <= 3.2e-21) tmp = ((t * a) + (x * z)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5e-146], t$95$1, If[LessEqual[y, 3.2e-21], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -5 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.99999999999999957e-146 or 3.2000000000000002e-21 < y Initial program 48.8%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6467.4%
Simplified67.4%
if -4.99999999999999957e-146 < y < 3.2000000000000002e-21Initial program 80.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6459.9%
Simplified59.9%
Final simplification64.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.9e-146)
t_1
(if (<= y -3.9e-267)
(/ (* x z) (+ x t))
(if (<= y 2.35e+72) (+ z a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.9e-146) {
tmp = t_1;
} else if (y <= -3.9e-267) {
tmp = (x * z) / (x + t);
} else if (y <= 2.35e+72) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-2.9d-146)) then
tmp = t_1
else if (y <= (-3.9d-267)) then
tmp = (x * z) / (x + t)
else if (y <= 2.35d+72) then
tmp = z + a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.9e-146) {
tmp = t_1;
} else if (y <= -3.9e-267) {
tmp = (x * z) / (x + t);
} else if (y <= 2.35e+72) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.9e-146: tmp = t_1 elif y <= -3.9e-267: tmp = (x * z) / (x + t) elif y <= 2.35e+72: tmp = z + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.9e-146) tmp = t_1; elseif (y <= -3.9e-267) tmp = Float64(Float64(x * z) / Float64(x + t)); elseif (y <= 2.35e+72) tmp = Float64(z + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -2.9e-146) tmp = t_1; elseif (y <= -3.9e-267) tmp = (x * z) / (x + t); elseif (y <= 2.35e+72) tmp = z + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.9e-146], t$95$1, If[LessEqual[y, -3.9e-267], N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.35e+72], N[(z + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-267}:\\
\;\;\;\;\frac{x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{+72}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.90000000000000011e-146 or 2.35000000000000017e72 < y Initial program 45.7%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.5%
Simplified68.5%
if -2.90000000000000011e-146 < y < -3.89999999999999977e-267Initial program 82.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6469.3%
Simplified69.3%
Taylor expanded in a around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6452.1%
Simplified52.1%
if -3.89999999999999977e-267 < y < 2.35000000000000017e72Initial program 78.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6441.1%
Simplified41.1%
Taylor expanded in b around 0
+-commutativeN/A
+-lowering-+.f6452.3%
Simplified52.3%
Final simplification61.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.5e-136)
t_1
(if (<= y -1.7e-263) z (if (<= y 5.4e+71) (+ z a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.5e-136) {
tmp = t_1;
} else if (y <= -1.7e-263) {
tmp = z;
} else if (y <= 5.4e+71) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.5d-136)) then
tmp = t_1
else if (y <= (-1.7d-263)) then
tmp = z
else if (y <= 5.4d+71) then
tmp = z + a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.5e-136) {
tmp = t_1;
} else if (y <= -1.7e-263) {
tmp = z;
} else if (y <= 5.4e+71) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.5e-136: tmp = t_1 elif y <= -1.7e-263: tmp = z elif y <= 5.4e+71: tmp = z + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.5e-136) tmp = t_1; elseif (y <= -1.7e-263) tmp = z; elseif (y <= 5.4e+71) tmp = Float64(z + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.5e-136) tmp = t_1; elseif (y <= -1.7e-263) tmp = z; elseif (y <= 5.4e+71) tmp = z + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.5e-136], t$95$1, If[LessEqual[y, -1.7e-263], z, If[LessEqual[y, 5.4e+71], N[(z + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-263}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+71}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.4999999999999999e-136 or 5.39999999999999993e71 < y Initial program 46.0%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.3%
Simplified68.3%
if -1.4999999999999999e-136 < y < -1.70000000000000002e-263Initial program 82.4%
Taylor expanded in x around inf
Simplified51.7%
if -1.70000000000000002e-263 < y < 5.39999999999999993e71Initial program 77.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6441.3%
Simplified41.3%
Taylor expanded in b around 0
+-commutativeN/A
+-lowering-+.f6452.4%
Simplified52.4%
Final simplification61.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -15500000000000.0) (+ a (* y (/ (- z b) t))) (if (<= t 2.3e+225) (- (+ z a) b) (+ a (* x (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -15500000000000.0) {
tmp = a + (y * ((z - b) / t));
} else if (t <= 2.3e+225) {
tmp = (z + a) - b;
} else {
tmp = a + (x * ((z - a) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-15500000000000.0d0)) then
tmp = a + (y * ((z - b) / t))
else if (t <= 2.3d+225) then
tmp = (z + a) - b
else
tmp = a + (x * ((z - a) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -15500000000000.0) {
tmp = a + (y * ((z - b) / t));
} else if (t <= 2.3e+225) {
tmp = (z + a) - b;
} else {
tmp = a + (x * ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -15500000000000.0: tmp = a + (y * ((z - b) / t)) elif t <= 2.3e+225: tmp = (z + a) - b else: tmp = a + (x * ((z - a) / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -15500000000000.0) tmp = Float64(a + Float64(y * Float64(Float64(z - b) / t))); elseif (t <= 2.3e+225) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a + Float64(x * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -15500000000000.0) tmp = a + (y * ((z - b) / t)); elseif (t <= 2.3e+225) tmp = (z + a) - b; else tmp = a + (x * ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -15500000000000.0], N[(a + N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e+225], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -15500000000000:\\
\;\;\;\;a + y \cdot \frac{z - b}{t}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+225}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + x \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if t < -1.55e13Initial program 55.5%
Taylor expanded in t around -inf
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified56.0%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6465.8%
Simplified65.8%
if -1.55e13 < t < 2.3e225Initial program 63.5%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6458.5%
Simplified58.5%
if 2.3e225 < t Initial program 43.5%
Taylor expanded in t around -inf
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified43.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
--lowering--.f6446.1%
Simplified46.1%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.0%
Applied egg-rr71.0%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -15500000000000.0) (+ a (* y (/ (- z b) t))) (if (<= t 9.6e+222) (- (+ z a) b) (+ a (/ (* x z) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -15500000000000.0) {
tmp = a + (y * ((z - b) / t));
} else if (t <= 9.6e+222) {
tmp = (z + a) - b;
} else {
tmp = a + ((x * z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-15500000000000.0d0)) then
tmp = a + (y * ((z - b) / t))
else if (t <= 9.6d+222) then
tmp = (z + a) - b
else
tmp = a + ((x * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -15500000000000.0) {
tmp = a + (y * ((z - b) / t));
} else if (t <= 9.6e+222) {
tmp = (z + a) - b;
} else {
tmp = a + ((x * z) / t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -15500000000000.0: tmp = a + (y * ((z - b) / t)) elif t <= 9.6e+222: tmp = (z + a) - b else: tmp = a + ((x * z) / t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -15500000000000.0) tmp = Float64(a + Float64(y * Float64(Float64(z - b) / t))); elseif (t <= 9.6e+222) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a + Float64(Float64(x * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -15500000000000.0) tmp = a + (y * ((z - b) / t)); elseif (t <= 9.6e+222) tmp = (z + a) - b; else tmp = a + ((x * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -15500000000000.0], N[(a + N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.6e+222], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(N[(x * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -15500000000000:\\
\;\;\;\;a + y \cdot \frac{z - b}{t}\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+222}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + \frac{x \cdot z}{t}\\
\end{array}
\end{array}
if t < -1.55e13Initial program 55.5%
Taylor expanded in t around -inf
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified56.0%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6465.8%
Simplified65.8%
if -1.55e13 < t < 9.6000000000000004e222Initial program 63.5%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6458.5%
Simplified58.5%
if 9.6000000000000004e222 < t Initial program 43.5%
Taylor expanded in t around -inf
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified43.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
--lowering--.f6446.1%
Simplified46.1%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6462.3%
Simplified62.3%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -9.5e+134) (- a b) (if (<= b 1.95e+202) (+ z a) (- z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.5e+134) {
tmp = a - b;
} else if (b <= 1.95e+202) {
tmp = z + a;
} else {
tmp = z - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-9.5d+134)) then
tmp = a - b
else if (b <= 1.95d+202) then
tmp = z + a
else
tmp = z - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.5e+134) {
tmp = a - b;
} else if (b <= 1.95e+202) {
tmp = z + a;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -9.5e+134: tmp = a - b elif b <= 1.95e+202: tmp = z + a else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -9.5e+134) tmp = Float64(a - b); elseif (b <= 1.95e+202) tmp = Float64(z + a); else tmp = Float64(z - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -9.5e+134) tmp = a - b; elseif (b <= 1.95e+202) tmp = z + a; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -9.5e+134], N[(a - b), $MachinePrecision], If[LessEqual[b, 1.95e+202], N[(z + a), $MachinePrecision], N[(z - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{+134}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+202}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if b < -9.5000000000000004e134Initial program 48.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6447.8%
Simplified47.8%
Taylor expanded in z around 0
--lowering--.f6444.8%
Simplified44.8%
if -9.5000000000000004e134 < b < 1.94999999999999992e202Initial program 64.8%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6456.8%
Simplified56.8%
Taylor expanded in b around 0
+-commutativeN/A
+-lowering-+.f6458.1%
Simplified58.1%
if 1.94999999999999992e202 < b Initial program 44.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6441.9%
Simplified41.9%
Taylor expanded in a around 0
--lowering--.f6442.0%
Simplified42.0%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.4e+135) (- a b) (if (<= b 9e+192) (+ z a) (- a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.4e+135) {
tmp = a - b;
} else if (b <= 9e+192) {
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 <= (-1.4d+135)) then
tmp = a - b
else if (b <= 9d+192) 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 <= -1.4e+135) {
tmp = a - b;
} else if (b <= 9e+192) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.4e+135: tmp = a - b elif b <= 9e+192: tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.4e+135) tmp = Float64(a - b); elseif (b <= 9e+192) 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 <= -1.4e+135) tmp = a - b; elseif (b <= 9e+192) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.4e+135], N[(a - b), $MachinePrecision], If[LessEqual[b, 9e+192], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.4 \cdot 10^{+135}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;b \leq 9 \cdot 10^{+192}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if b < -1.40000000000000001e135 or 9e192 < b Initial program 46.3%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6446.3%
Simplified46.3%
Taylor expanded in z around 0
--lowering--.f6442.0%
Simplified42.0%
if -1.40000000000000001e135 < b < 9e192Initial program 65.1%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6456.6%
Simplified56.6%
Taylor expanded in b around 0
+-commutativeN/A
+-lowering-+.f6458.1%
Simplified58.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4e+65) a (if (<= a 9e+46) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4e+65) {
tmp = a;
} else if (a <= 9e+46) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-4d+65)) then
tmp = a
else if (a <= 9d+46) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4e+65) {
tmp = a;
} else if (a <= 9e+46) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4e+65: tmp = a elif a <= 9e+46: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4e+65) tmp = a; elseif (a <= 9e+46) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4e+65) tmp = a; elseif (a <= 9e+46) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4e+65], a, If[LessEqual[a, 9e+46], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{+65}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+46}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -4e65 or 9.00000000000000019e46 < a Initial program 44.7%
Taylor expanded in t around inf
Simplified51.3%
if -4e65 < a < 9.00000000000000019e46Initial program 71.8%
Taylor expanded in x around inf
Simplified44.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b 3.6e+195) (+ z a) (- 0.0 b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 3.6e+195) {
tmp = z + a;
} else {
tmp = 0.0 - 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 <= 3.6d+195) then
tmp = z + a
else
tmp = 0.0d0 - 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 <= 3.6e+195) {
tmp = z + a;
} else {
tmp = 0.0 - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 3.6e+195: tmp = z + a else: tmp = 0.0 - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 3.6e+195) tmp = Float64(z + a); else tmp = Float64(0.0 - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 3.6e+195) tmp = z + a; else tmp = 0.0 - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 3.6e+195], N[(z + a), $MachinePrecision], N[(0.0 - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.6 \cdot 10^{+195}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;0 - b\\
\end{array}
\end{array}
if b < 3.5999999999999999e195Initial program 62.4%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6455.5%
Simplified55.5%
Taylor expanded in b around 0
+-commutativeN/A
+-lowering-+.f6453.7%
Simplified53.7%
if 3.5999999999999999e195 < b Initial program 44.6%
Taylor expanded in t around inf
*-lowering-*.f6436.6%
Simplified36.6%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6435.6%
Simplified35.6%
Final simplification52.0%
(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 60.8%
Taylor expanded in t around inf
Simplified29.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024163
(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)))