
(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 (* z (+ x y)))
(t_4 (/ (- (+ t_3 (* (+ y t) a)) (* y b)) t_1)))
(if (<= t_4 (- INFINITY))
t_2
(if (<= t_4 2e+221) (/ (fma a t (fma y (- a b) t_3)) 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 = z * (x + y);
double t_4 = ((t_3 + ((y + t) * a)) - (y * b)) / t_1;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_4 <= 2e+221) {
tmp = fma(a, t, fma(y, (a - b), t_3)) / 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(z * Float64(x + y)) t_4 = Float64(Float64(Float64(t_3 + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_2; elseif (t_4 <= 2e+221) tmp = Float64(fma(a, t, fma(y, Float64(a - b), t_3)) / t_1); else tmp = t_2; 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 + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(N[(y + t), $MachinePrecision] * a), $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, 2e+221], N[(N[(a * t + N[(y * N[(a - b), $MachinePrecision] + t$95$3), $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 := z \cdot \left(x + y\right)\\
t_4 := \frac{\left(t\_3 + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+221}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(y, a - b, t\_3\right)\right)}{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 2.0000000000000001e221 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6473.8
Simplified73.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)) < 2.0000000000000001e221Initial program 99.6%
Taylor expanded in y around 0
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6
Simplified99.6%
Taylor expanded in z around 0
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6499.7
Simplified99.7%
Final simplification88.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (- (+ z a) b))
(t_3 (* z (+ x y)))
(t_4 (/ (- (+ t_3 (* (+ y t) a)) (* y b)) t_1)))
(if (<= t_4 (- INFINITY))
t_2
(if (<= t_4 2e+221) (/ (fma y (- a b) t_3) 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 = z * (x + y);
double t_4 = ((t_3 + ((y + t) * a)) - (y * b)) / t_1;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_4 <= 2e+221) {
tmp = fma(y, (a - b), t_3) / 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(z * Float64(x + y)) t_4 = Float64(Float64(Float64(t_3 + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_2; elseif (t_4 <= 2e+221) tmp = Float64(fma(y, Float64(a - b), t_3) / t_1); else tmp = t_2; 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 + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(N[(y + t), $MachinePrecision] * a), $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, 2e+221], N[(N[(y * N[(a - b), $MachinePrecision] + t$95$3), $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 := z \cdot \left(x + y\right)\\
t_4 := \frac{\left(t\_3 + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+221}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, a - b, t\_3\right)}{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 2.0000000000000001e221 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6473.8
Simplified73.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)) < 2.0000000000000001e221Initial program 99.6%
Taylor expanded in y around 0
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6
Simplified99.6%
Taylor expanded in z around 0
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6499.7
Simplified99.7%
Taylor expanded in t around 0
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6478.9
Simplified78.9%
Final simplification76.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) t_1))
(t_3 (- (+ z a) b)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 2e+221) (/ (fma y (- z b) (* x z)) t_1) t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 2e+221) {
tmp = fma(y, (z - b), (x * z)) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 2e+221) tmp = Float64(fma(y, Float64(z - b), Float64(x * z)) / t_1); else tmp = t_3; 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[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 2e+221], N[(N[(y * N[(z - b), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+221}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, z - b, x \cdot z\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 2.0000000000000001e221 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6473.8
Simplified73.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)) < 2.0000000000000001e221Initial program 99.6%
Taylor expanded in y around 0
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6
Simplified99.6%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-lowering-*.f6464.4
Simplified64.4%
Final simplification68.6%
(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 (- (+ z a) b)))
(if (<= t_1 -1e+267)
t_2
(if (<= t_1 2e+221) (/ (fma a t (* y t_2)) (+ y t)) 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 = (z + a) - b;
double tmp;
if (t_1 <= -1e+267) {
tmp = t_2;
} else if (t_1 <= 2e+221) {
tmp = fma(a, t, (y * t_2)) / (y + t);
} 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(Float64(z + a) - b) tmp = 0.0 if (t_1 <= -1e+267) tmp = t_2; elseif (t_1 <= 2e+221) tmp = Float64(fma(a, t, Float64(y * t_2)) / Float64(y + t)); else tmp = t_2; 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[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+267], t$95$2, If[LessEqual[t$95$1, 2e+221], N[(N[(a * t + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision], 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 := \left(z + a\right) - b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+267}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+221}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, y \cdot t\_2\right)}{y + t}\\
\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)) < -9.9999999999999997e266 or 2.0000000000000001e221 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 11.2%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6472.7
Simplified72.7%
if -9.9999999999999997e266 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e221Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate--l+N/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-out--N/A
distribute-lft-inN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6461.7
Simplified61.7%
Final simplification66.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.45e-122)
t_1
(if (<= y 2.1e-165)
(/ (fma a t (* x z)) (+ x t))
(if (<= y 2.05e-44) (/ (- (* x z) (* y b)) (+ y (+ 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.45e-122) {
tmp = t_1;
} else if (y <= 2.1e-165) {
tmp = fma(a, t, (x * z)) / (x + t);
} else if (y <= 2.05e-44) {
tmp = ((x * z) - (y * b)) / (y + (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.45e-122) tmp = t_1; elseif (y <= 2.1e-165) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(x + t)); elseif (y <= 2.05e-44) tmp = Float64(Float64(Float64(x * z) - Float64(y * b)) / Float64(y + Float64(x + t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.45e-122], t$95$1, If[LessEqual[y, 2.1e-165], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-44], N[(N[(N[(x * z), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-165}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{x + t}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-44}:\\
\;\;\;\;\frac{x \cdot z - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.4500000000000001e-122 or 2.04999999999999996e-44 < y Initial program 46.4%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.3
Simplified68.3%
if -1.4500000000000001e-122 < y < 2.09999999999999995e-165Initial program 78.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6464.5
Simplified64.5%
if 2.09999999999999995e-165 < y < 2.04999999999999996e-44Initial program 83.5%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6468.1
Simplified68.1%
Final simplification67.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.5e-122)
t_1
(if (<= y 1.65e-43) (/ (fma a t (* 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 <= -1.5e-122) {
tmp = t_1;
} else if (y <= 1.65e-43) {
tmp = fma(a, t, (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 <= -1.5e-122) tmp = t_1; elseif (y <= 1.65e-43) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(x + t)); else tmp = t_1; end return 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-122], t$95$1, If[LessEqual[y, 1.65e-43], N[(N[(a * t + 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 -1.5 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.50000000000000002e-122 or 1.65000000000000008e-43 < y Initial program 46.4%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.3
Simplified68.3%
if -1.50000000000000002e-122 < y < 1.65000000000000008e-43Initial program 79.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6460.1
Simplified60.1%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (/ (+ x y) (+ t (+ x y)))))) (if (<= x -2.3e+17) t_1 (if (<= x 1.1e+151) (- (+ z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((x + y) / (t + (x + y)));
double tmp;
if (x <= -2.3e+17) {
tmp = t_1;
} else if (x <= 1.1e+151) {
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 * ((x + y) / (t + (x + y)))
if (x <= (-2.3d+17)) then
tmp = t_1
else if (x <= 1.1d+151) 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 * ((x + y) / (t + (x + y)));
double tmp;
if (x <= -2.3e+17) {
tmp = t_1;
} else if (x <= 1.1e+151) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * ((x + y) / (t + (x + y))) tmp = 0 if x <= -2.3e+17: tmp = t_1 elif x <= 1.1e+151: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(Float64(x + y) / Float64(t + Float64(x + y)))) tmp = 0.0 if (x <= -2.3e+17) tmp = t_1; elseif (x <= 1.1e+151) 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 * ((x + y) / (t + (x + y))); tmp = 0.0; if (x <= -2.3e+17) tmp = t_1; elseif (x <= 1.1e+151) 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[(z * N[(N[(x + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e+17], t$95$1, If[LessEqual[x, 1.1e+151], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x + y}{t + \left(x + y\right)}\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+151}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.3e17 or 1.10000000000000003e151 < x Initial program 53.3%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6428.9
Simplified28.9%
associate-/l*N/A
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6462.5
Applied egg-rr62.5%
if -2.3e17 < x < 1.10000000000000003e151Initial program 61.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6465.6
Simplified65.6%
Final simplification64.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (* x (/ 1.0 (+ x t)))))) (if (<= x -2.1e+17) t_1 (if (<= x 1.15e+151) (- (+ z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x * (1.0 / (x + t)));
double tmp;
if (x <= -2.1e+17) {
tmp = t_1;
} else if (x <= 1.15e+151) {
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 * (x * (1.0d0 / (x + t)))
if (x <= (-2.1d+17)) then
tmp = t_1
else if (x <= 1.15d+151) 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 * (x * (1.0 / (x + t)));
double tmp;
if (x <= -2.1e+17) {
tmp = t_1;
} else if (x <= 1.15e+151) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x * (1.0 / (x + t))) tmp = 0 if x <= -2.1e+17: tmp = t_1 elif x <= 1.15e+151: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x * Float64(1.0 / Float64(x + t)))) tmp = 0.0 if (x <= -2.1e+17) tmp = t_1; elseif (x <= 1.15e+151) 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 * (x * (1.0 / (x + t))); tmp = 0.0; if (x <= -2.1e+17) tmp = t_1; elseif (x <= 1.15e+151) 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[(z * N[(x * N[(1.0 / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+17], t$95$1, If[LessEqual[x, 1.15e+151], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot \frac{1}{x + t}\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+151}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.1e17 or 1.15e151 < x Initial program 53.3%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6428.9
Simplified28.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6429.0
Simplified29.0%
div-invN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
/-lowering-/.f64N/A
+-lowering-+.f6460.9
Applied egg-rr60.9%
if -2.1e17 < x < 1.15e151Initial program 61.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6465.6
Simplified65.6%
Final simplification64.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.3e+17) (* x (/ z (+ x t))) (if (<= x 7e+192) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.3e+17) {
tmp = x * (z / (x + t));
} else if (x <= 7e+192) {
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 <= (-2.3d+17)) then
tmp = x * (z / (x + t))
else if (x <= 7d+192) 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 <= -2.3e+17) {
tmp = x * (z / (x + t));
} else if (x <= 7e+192) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.3e+17: tmp = x * (z / (x + t)) elif x <= 7e+192: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.3e+17) tmp = Float64(x * Float64(z / Float64(x + t))); elseif (x <= 7e+192) 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 <= -2.3e+17) tmp = x * (z / (x + t)); elseif (x <= 7e+192) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.3e+17], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+192], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+192}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.3e17Initial program 53.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6427.5
Simplified27.5%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6427.6
Simplified27.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
/-lowering-/.f64N/A
+-lowering-+.f6453.7
Applied egg-rr53.7%
if -2.3e17 < x < 6.99999999999999965e192Initial program 60.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6464.7
Simplified64.7%
if 6.99999999999999965e192 < x Initial program 55.0%
Taylor expanded in x around inf
Simplified77.5%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.8e+109) z (if (<= x 5.1e+194) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.8e+109) {
tmp = z;
} else if (x <= 5.1e+194) {
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 <= (-2.8d+109)) then
tmp = z
else if (x <= 5.1d+194) 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 <= -2.8e+109) {
tmp = z;
} else if (x <= 5.1e+194) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.8e+109: tmp = z elif x <= 5.1e+194: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.8e+109) tmp = z; elseif (x <= 5.1e+194) 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 <= -2.8e+109) tmp = z; elseif (x <= 5.1e+194) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.8e+109], z, If[LessEqual[x, 5.1e+194], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+109}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{+194}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.8000000000000002e109 or 5.1000000000000002e194 < x Initial program 48.9%
Taylor expanded in x around inf
Simplified64.4%
if -2.8000000000000002e109 < x < 5.1000000000000002e194Initial program 62.0%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6462.5
Simplified62.5%
Final simplification63.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.2e-107) (- z b) (if (<= z 7.6e+77) (- a b) (- z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.2e-107) {
tmp = z - b;
} else if (z <= 7.6e+77) {
tmp = a - b;
} 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 (z <= (-2.2d-107)) then
tmp = z - b
else if (z <= 7.6d+77) then
tmp = a - b
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 (z <= -2.2e-107) {
tmp = z - b;
} else if (z <= 7.6e+77) {
tmp = a - b;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.2e-107: tmp = z - b elif z <= 7.6e+77: tmp = a - b else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.2e-107) tmp = Float64(z - b); elseif (z <= 7.6e+77) tmp = Float64(a - b); else tmp = Float64(z - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.2e-107) tmp = z - b; elseif (z <= 7.6e+77) tmp = a - b; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.2e-107], N[(z - b), $MachinePrecision], If[LessEqual[z, 7.6e+77], N[(a - b), $MachinePrecision], N[(z - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-107}:\\
\;\;\;\;z - b\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+77}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if z < -2.20000000000000012e-107 or 7.6000000000000002e77 < z Initial program 50.0%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6457.4
Simplified57.4%
Taylor expanded in a around 0
--lowering--.f6455.2
Simplified55.2%
if -2.20000000000000012e-107 < z < 7.6000000000000002e77Initial program 70.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6455.5
Simplified55.5%
Taylor expanded in z around 0
--lowering--.f6452.6
Simplified52.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.02e-17) z (if (<= x 1.35e+90) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.02e-17) {
tmp = z;
} else if (x <= 1.35e+90) {
tmp = 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 <= (-1.02d-17)) then
tmp = z
else if (x <= 1.35d+90) then
tmp = 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 <= -1.02e-17) {
tmp = z;
} else if (x <= 1.35e+90) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.02e-17: tmp = z elif x <= 1.35e+90: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.02e-17) tmp = z; elseif (x <= 1.35e+90) tmp = Float64(a - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.02e-17) tmp = z; elseif (x <= 1.35e+90) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.02e-17], z, If[LessEqual[x, 1.35e+90], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-17}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+90}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.01999999999999997e-17 or 1.35e90 < x Initial program 54.7%
Taylor expanded in x around inf
Simplified51.4%
if -1.01999999999999997e-17 < x < 1.35e90Initial program 62.1%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6466.3
Simplified66.3%
Taylor expanded in z around 0
--lowering--.f6454.4
Simplified54.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8e+19) z (if (<= z 2.65e-25) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8e+19) {
tmp = z;
} else if (z <= 2.65e-25) {
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 <= (-8d+19)) then
tmp = z
else if (z <= 2.65d-25) 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 <= -8e+19) {
tmp = z;
} else if (z <= 2.65e-25) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8e+19: tmp = z elif z <= 2.65e-25: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8e+19) tmp = z; elseif (z <= 2.65e-25) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -8e+19) tmp = z; elseif (z <= 2.65e-25) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8e+19], z, If[LessEqual[z, 2.65e-25], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+19}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-25}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -8e19 or 2.6499999999999998e-25 < z Initial program 49.7%
Taylor expanded in x around inf
Simplified48.3%
if -8e19 < z < 2.6499999999999998e-25Initial program 69.5%
Taylor expanded in t around inf
Simplified45.2%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 58.8%
Taylor expanded in t around inf
Simplified28.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 2024198
(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)))