
(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 18 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 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3
(*
(-
(* (/ (+ y x) t_1) (/ z a))
(fma (/ b a) (/ y t_1) (/ (- (+ t y)) t_1)))
a)))
(if (<= t_2 (- INFINITY)) t_3 (if (<= t_2 5e+306) t_2 t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = ((((y + x) / t_1) * (z / a)) - fma((b / a), (y / t_1), (-(t + y) / t_1))) * a;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 5e+306) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(Float64(Float64(Float64(y + x) / t_1) * Float64(z / a)) - fma(Float64(b / a), Float64(y / t_1), Float64(Float64(-Float64(t + y)) / t_1))) * a) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 5e+306) tmp = t_2; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(z / a), $MachinePrecision]), $MachinePrecision] - N[(N[(b / a), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision] + N[((-N[(t + y), $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 5e+306], t$95$2, t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(\frac{y + x}{t\_1} \cdot \frac{z}{a} - \mathsf{fma}\left(\frac{b}{a}, \frac{y}{t\_1}, \frac{-\left(t + y\right)}{t\_1}\right)\right) \cdot a\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\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 4.99999999999999993e306 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.5%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites6.1%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites79.6%
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.99999999999999993e306Initial program 99.6%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3 (- (+ a z) b))
(t_4 (/ (fma (- a b) y (* a t)) t_1)))
(if (<= t_2 -5e+151)
t_3
(if (<= t_2 -1e+87)
t_4
(if (<= t_2 -5e-41)
(/ (fma (- z b) y (* z x)) t_1)
(if (<= t_2 2e-115)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 4e+164) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = (a + z) - b;
double t_4 = fma((a - b), y, (a * t)) / t_1;
double tmp;
if (t_2 <= -5e+151) {
tmp = t_3;
} else if (t_2 <= -1e+87) {
tmp = t_4;
} else if (t_2 <= -5e-41) {
tmp = fma((z - b), y, (z * x)) / t_1;
} else if (t_2 <= 2e-115) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 4e+164) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(a + z) - b) t_4 = Float64(fma(Float64(a - b), y, Float64(a * t)) / t_1) tmp = 0.0 if (t_2 <= -5e+151) tmp = t_3; elseif (t_2 <= -1e+87) tmp = t_4; elseif (t_2 <= -5e-41) tmp = Float64(fma(Float64(z - b), y, Float64(z * x)) / t_1); elseif (t_2 <= 2e-115) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 4e+164) tmp = t_4; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(a - b), $MachinePrecision] * y + N[(a * t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+151], t$95$3, If[LessEqual[t$95$2, -1e+87], t$95$4, If[LessEqual[t$95$2, -5e-41], N[(N[(N[(z - b), $MachinePrecision] * y + N[(z * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e-115], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+164], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(a + z\right) - b\\
t_4 := \frac{\mathsf{fma}\left(a - b, y, a \cdot t\right)}{t\_1}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+87}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z - b, y, z \cdot x\right)}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-115}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;t\_4\\
\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)) < -5.0000000000000002e151 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 24.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6471.3
Applied rewrites71.3%
if -5.0000000000000002e151 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999996e86 or 2.0000000000000001e-115 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6483.8
Applied rewrites83.8%
Taylor expanded in y around 0
Applied rewrites83.9%
if -9.9999999999999996e86 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.9999999999999996e-41Initial program 99.8%
Taylor expanded in a around 0
distribute-rgt-inN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f6477.5
Applied rewrites77.5%
Applied rewrites77.5%
if -4.9999999999999996e-41 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e-115Initial program 99.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6474.6
Applied rewrites74.6%
Final simplification75.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3 (- (+ a z) b))
(t_4 (/ (fma (- a b) y (* a t)) t_1)))
(if (<= t_2 -5e+151)
t_3
(if (<= t_2 -1e+87)
t_4
(if (<= t_2 -5e-41)
(/ (fma z x (* (- z b) y)) t_1)
(if (<= t_2 2e-115)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 4e+164) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = (a + z) - b;
double t_4 = fma((a - b), y, (a * t)) / t_1;
double tmp;
if (t_2 <= -5e+151) {
tmp = t_3;
} else if (t_2 <= -1e+87) {
tmp = t_4;
} else if (t_2 <= -5e-41) {
tmp = fma(z, x, ((z - b) * y)) / t_1;
} else if (t_2 <= 2e-115) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 4e+164) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(a + z) - b) t_4 = Float64(fma(Float64(a - b), y, Float64(a * t)) / t_1) tmp = 0.0 if (t_2 <= -5e+151) tmp = t_3; elseif (t_2 <= -1e+87) tmp = t_4; elseif (t_2 <= -5e-41) tmp = Float64(fma(z, x, Float64(Float64(z - b) * y)) / t_1); elseif (t_2 <= 2e-115) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 4e+164) tmp = t_4; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(a - b), $MachinePrecision] * y + N[(a * t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+151], t$95$3, If[LessEqual[t$95$2, -1e+87], t$95$4, If[LessEqual[t$95$2, -5e-41], N[(N[(z * x + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e-115], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+164], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(a + z\right) - b\\
t_4 := \frac{\mathsf{fma}\left(a - b, y, a \cdot t\right)}{t\_1}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+87}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, x, \left(z - b\right) \cdot y\right)}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-115}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;t\_4\\
\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)) < -5.0000000000000002e151 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 24.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6471.3
Applied rewrites71.3%
if -5.0000000000000002e151 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999996e86 or 2.0000000000000001e-115 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6483.8
Applied rewrites83.8%
Taylor expanded in y around 0
Applied rewrites83.9%
if -9.9999999999999996e86 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.9999999999999996e-41Initial program 99.8%
Taylor expanded in a around 0
distribute-rgt-inN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f6477.5
Applied rewrites77.5%
if -4.9999999999999996e-41 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e-115Initial program 99.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6474.6
Applied rewrites74.6%
Final simplification75.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3 (- (+ a z) b)))
(if (<= t_2 -2e+293)
t_3
(if (<= t_2 -1e-195)
(fma 1.0 a (/ (fma z x (* (- z b) y)) (+ t (+ y x))))
(if (<= t_2 2e-115)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 4e+164) (/ (fma (- a b) y (* a t)) t_1) t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -2e+293) {
tmp = t_3;
} else if (t_2 <= -1e-195) {
tmp = fma(1.0, a, (fma(z, x, ((z - b) * y)) / (t + (y + x))));
} else if (t_2 <= 2e-115) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 4e+164) {
tmp = fma((a - b), y, (a * t)) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= -2e+293) tmp = t_3; elseif (t_2 <= -1e-195) tmp = fma(1.0, a, Float64(fma(z, x, Float64(Float64(z - b) * y)) / Float64(t + Float64(y + x)))); elseif (t_2 <= 2e-115) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 4e+164) tmp = Float64(fma(Float64(a - b), y, Float64(a * t)) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+293], t$95$3, If[LessEqual[t$95$2, -1e-195], N[(1.0 * a + N[(N[(z * x + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-115], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+164], N[(N[(N[(a - b), $MachinePrecision] * y + N[(a * t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+293}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-195}:\\
\;\;\;\;\mathsf{fma}\left(1, a, \frac{\mathsf{fma}\left(z, x, \left(z - b\right) \cdot y\right)}{t + \left(y + x\right)}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-115}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a - b, y, a \cdot t\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)) < -1.9999999999999998e293 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 16.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6471.7
Applied rewrites71.7%
if -1.9999999999999998e293 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.0000000000000001e-195Initial program 99.7%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in y around inf
Applied rewrites87.4%
if -1.0000000000000001e-195 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e-115Initial program 99.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6486.8
Applied rewrites86.8%
if 2.0000000000000001e-115 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.6%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6482.6
Applied rewrites82.6%
Taylor expanded in y around 0
Applied rewrites82.6%
Final simplification79.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3 (- (+ a z) b))
(t_4 (/ (fma (- a b) y (* a t)) t_1)))
(if (<= t_2 -5e+151)
t_3
(if (<= t_2 -8.5e+21)
t_4
(if (<= t_2 2e-115)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 4e+164) t_4 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = (a + z) - b;
double t_4 = fma((a - b), y, (a * t)) / t_1;
double tmp;
if (t_2 <= -5e+151) {
tmp = t_3;
} else if (t_2 <= -8.5e+21) {
tmp = t_4;
} else if (t_2 <= 2e-115) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 4e+164) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(a + z) - b) t_4 = Float64(fma(Float64(a - b), y, Float64(a * t)) / t_1) tmp = 0.0 if (t_2 <= -5e+151) tmp = t_3; elseif (t_2 <= -8.5e+21) tmp = t_4; elseif (t_2 <= 2e-115) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 4e+164) tmp = t_4; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(a - b), $MachinePrecision] * y + N[(a * t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+151], t$95$3, If[LessEqual[t$95$2, -8.5e+21], t$95$4, If[LessEqual[t$95$2, 2e-115], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+164], t$95$4, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(a + z\right) - b\\
t_4 := \frac{\mathsf{fma}\left(a - b, y, a \cdot t\right)}{t\_1}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -8.5 \cdot 10^{+21}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-115}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;t\_4\\
\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)) < -5.0000000000000002e151 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 24.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6471.3
Applied rewrites71.3%
if -5.0000000000000002e151 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -8.5e21 or 2.0000000000000001e-115 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6478.4
Applied rewrites78.4%
Taylor expanded in y around 0
Applied rewrites78.4%
if -8.5e21 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e-115Initial program 99.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6467.4
Applied rewrites67.4%
Final simplification72.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3 (- (+ a z) b)))
(if (<= t_2 -2e+244)
t_3
(if (<= t_2 -2e+27)
(/ (fma (+ t y) a (* (- z b) y)) (+ t y))
(if (<= t_2 100000.0)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 4e+164) (/ (* t_3 y) t_1) t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -2e+244) {
tmp = t_3;
} else if (t_2 <= -2e+27) {
tmp = fma((t + y), a, ((z - b) * y)) / (t + y);
} else if (t_2 <= 100000.0) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 4e+164) {
tmp = (t_3 * y) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= -2e+244) tmp = t_3; elseif (t_2 <= -2e+27) tmp = Float64(fma(Float64(t + y), a, Float64(Float64(z - b) * y)) / Float64(t + y)); elseif (t_2 <= 100000.0) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 4e+164) tmp = Float64(Float64(t_3 * y) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+244], t$95$3, If[LessEqual[t$95$2, -2e+27], N[(N[(N[(t + y), $MachinePrecision] * a + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 100000.0], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+164], N[(N[(t$95$3 * y), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+244}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+27}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, \left(z - b\right) \cdot y\right)}{t + y}\\
\mathbf{elif}\;t\_2 \leq 100000:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;\frac{t\_3 \cdot y}{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)) < -2.00000000000000015e244 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 20.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.7
Applied rewrites70.7%
if -2.00000000000000015e244 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e27Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6474.0
Applied rewrites74.0%
if -2e27 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e5Initial program 99.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6467.9
Applied rewrites67.9%
if 1e5 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6465.0
Applied rewrites65.0%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3 (- (+ a z) b))
(t_4 (/ (* t_3 y) t_1)))
(if (<= t_2 -2e+125)
t_3
(if (<= t_2 -8.5e+21)
t_4
(if (<= t_2 100000.0)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 4e+164) t_4 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = (a + z) - b;
double t_4 = (t_3 * y) / t_1;
double tmp;
if (t_2 <= -2e+125) {
tmp = t_3;
} else if (t_2 <= -8.5e+21) {
tmp = t_4;
} else if (t_2 <= 100000.0) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 4e+164) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(a + z) - b) t_4 = Float64(Float64(t_3 * y) / t_1) tmp = 0.0 if (t_2 <= -2e+125) tmp = t_3; elseif (t_2 <= -8.5e+21) tmp = t_4; elseif (t_2 <= 100000.0) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 4e+164) tmp = t_4; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 * y), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+125], t$95$3, If[LessEqual[t$95$2, -8.5e+21], t$95$4, If[LessEqual[t$95$2, 100000.0], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+164], t$95$4, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(a + z\right) - b\\
t_4 := \frac{t\_3 \cdot y}{t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+125}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -8.5 \cdot 10^{+21}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 100000:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;t\_4\\
\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)) < -1.9999999999999998e125 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 26.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.7
Applied rewrites70.7%
if -1.9999999999999998e125 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -8.5e21 or 1e5 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6465.1
Applied rewrites65.1%
if -8.5e21 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e5Initial program 99.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6468.8
Applied rewrites68.8%
Final simplification68.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y)))
(t_2 (- (+ a z) b)))
(if (<= t_1 -5e+84)
t_2
(if (<= t_1 1e-101)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_1 4e+164) (/ (fma (- a b) y (* a t)) (+ t x)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -5e+84) {
tmp = t_2;
} else if (t_1 <= 1e-101) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_1 <= 4e+164) {
tmp = fma((a - b), y, (a * t)) / (t + x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_1 <= -5e+84) tmp = t_2; elseif (t_1 <= 1e-101) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_1 <= 4e+164) tmp = Float64(fma(Float64(a - b), y, Float64(a * t)) / Float64(t + x)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+84], t$95$2, If[LessEqual[t$95$1, 1e-101], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+164], N[(N[(N[(a - b), $MachinePrecision] * y + N[(a * t), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-101}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a - b, y, a \cdot t\right)}{t + x}\\
\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)) < -5.0000000000000001e84 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 33.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6468.3
Applied rewrites68.3%
if -5.0000000000000001e84 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000005e-101Initial program 99.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6460.9
Applied rewrites60.9%
if 1.00000000000000005e-101 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.6%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6483.7
Applied rewrites83.7%
Taylor expanded in y around 0
Applied rewrites83.8%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f6466.9
Applied rewrites66.9%
Final simplification66.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
(t_3 (- (+ a z) b)))
(if (<= t_2 -5e+84)
t_3
(if (<= t_2 100000.0)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 4e+164) (/ (* (- a b) y) t_1) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -5e+84) {
tmp = t_3;
} else if (t_2 <= 100000.0) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 4e+164) {
tmp = ((a - b) * y) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= -5e+84) tmp = t_3; elseif (t_2 <= 100000.0) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 4e+164) tmp = Float64(Float64(Float64(a - b) * y) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+84], t$95$3, If[LessEqual[t$95$2, 100000.0], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+164], N[(N[(N[(a - b), $MachinePrecision] * y), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+84}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 100000:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+164}:\\
\;\;\;\;\frac{\left(a - b\right) \cdot y}{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)) < -5.0000000000000001e84 or 4e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 33.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6468.3
Applied rewrites68.3%
if -5.0000000000000001e84 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e5Initial program 99.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6464.6
Applied rewrites64.6%
if 1e5 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e164Initial program 99.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6482.0
Applied rewrites82.0%
Taylor expanded in y around inf
Applied rewrites57.7%
Final simplification66.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1)))
(if (<= t_2 -2e+293)
(- (+ a z) b)
(if (<= t_2 5e+306)
t_2
(* (- (* (/ (+ y x) t_1) (/ z a)) (- (/ b a) 1.0)) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double tmp;
if (t_2 <= -2e+293) {
tmp = (a + z) - b;
} else if (t_2 <= 5e+306) {
tmp = t_2;
} else {
tmp = ((((y + x) / t_1) * (z / a)) - ((b / a) - 1.0)) * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t + x) + y
t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1
if (t_2 <= (-2d+293)) then
tmp = (a + z) - b
else if (t_2 <= 5d+306) then
tmp = t_2
else
tmp = ((((y + x) / t_1) * (z / a)) - ((b / a) - 1.0d0)) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
double tmp;
if (t_2 <= -2e+293) {
tmp = (a + z) - b;
} else if (t_2 <= 5e+306) {
tmp = t_2;
} else {
tmp = ((((y + x) / t_1) * (z / a)) - ((b / a) - 1.0)) * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t + x) + y t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1 tmp = 0 if t_2 <= -2e+293: tmp = (a + z) - b elif t_2 <= 5e+306: tmp = t_2 else: tmp = ((((y + x) / t_1) * (z / a)) - ((b / a) - 1.0)) * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) tmp = 0.0 if (t_2 <= -2e+293) tmp = Float64(Float64(a + z) - b); elseif (t_2 <= 5e+306) tmp = t_2; else tmp = Float64(Float64(Float64(Float64(Float64(y + x) / t_1) * Float64(z / a)) - Float64(Float64(b / a) - 1.0)) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t + x) + y; t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1; tmp = 0.0; if (t_2 <= -2e+293) tmp = (a + z) - b; elseif (t_2 <= 5e+306) tmp = t_2; else tmp = ((((y + x) / t_1) * (z / a)) - ((b / a) - 1.0)) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+293], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$2, 5e+306], t$95$2, N[(N[(N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(z / a), $MachinePrecision]), $MachinePrecision] - N[(N[(b / a), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+293}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + x}{t\_1} \cdot \frac{z}{a} - \left(\frac{b}{a} - 1\right)\right) \cdot a\\
\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)) < -1.9999999999999998e293Initial program 8.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.6
Applied rewrites70.6%
if -1.9999999999999998e293 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.99999999999999993e306Initial program 99.6%
if 4.99999999999999993e306 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.6%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites5.7%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites87.3%
Taylor expanded in y around inf
Applied rewrites74.6%
Final simplification88.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y)))
(t_2 (- (+ a z) b)))
(if (<= t_1 -2e+293) t_2 (if (<= t_1 1e+254) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -2e+293) {
tmp = t_2;
} else if (t_1 <= 1e+254) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y)
t_2 = (a + z) - b
if (t_1 <= (-2d+293)) then
tmp = t_2
else if (t_1 <= 1d+254) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -2e+293) {
tmp = t_2;
} else if (t_1 <= 1e+254) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y) t_2 = (a + z) - b tmp = 0 if t_1 <= -2e+293: tmp = t_2 elif t_1 <= 1e+254: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_1 <= -2e+293) tmp = t_2; elseif (t_1 <= 1e+254) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y); t_2 = (a + z) - b; tmp = 0.0; if (t_1 <= -2e+293) tmp = t_2; elseif (t_1 <= 1e+254) 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[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+293], t$95$2, If[LessEqual[t$95$1, 1e+254], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+293}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+254}:\\
\;\;\;\;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)) < -1.9999999999999998e293 or 9.9999999999999994e253 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6472.0
Applied rewrites72.0%
if -1.9999999999999998e293 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999994e253Initial program 99.6%
Final simplification88.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y)))
(t_2 (- (+ a z) b)))
(if (<= t_1 -5e+84)
t_2
(if (<= t_1 1e+46) (/ (fma a t (* z x)) (+ t x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -5e+84) {
tmp = t_2;
} else if (t_1 <= 1e+46) {
tmp = fma(a, t, (z * x)) / (t + x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_1 <= -5e+84) tmp = t_2; elseif (t_1 <= 1e+46) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+84], t$95$2, If[LessEqual[t$95$1, 1e+46], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+46}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\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)) < -5.0000000000000001e84 or 9.9999999999999999e45 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 41.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6465.3
Applied rewrites65.3%
if -5.0000000000000001e84 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999999e45Initial program 99.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6462.0
Applied rewrites62.0%
Final simplification64.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ t (+ t x)) a)))
(if (<= t -6.2e+122)
t_1
(if (<= t -290000000.0)
(* (/ z (+ t (+ y x))) (+ y x))
(if (<= t 6e+161) (- (+ a z) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t / (t + x)) * a;
double tmp;
if (t <= -6.2e+122) {
tmp = t_1;
} else if (t <= -290000000.0) {
tmp = (z / (t + (y + x))) * (y + x);
} else if (t <= 6e+161) {
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 = (t / (t + x)) * a
if (t <= (-6.2d+122)) then
tmp = t_1
else if (t <= (-290000000.0d0)) then
tmp = (z / (t + (y + x))) * (y + x)
else if (t <= 6d+161) 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 = (t / (t + x)) * a;
double tmp;
if (t <= -6.2e+122) {
tmp = t_1;
} else if (t <= -290000000.0) {
tmp = (z / (t + (y + x))) * (y + x);
} else if (t <= 6e+161) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t / (t + x)) * a tmp = 0 if t <= -6.2e+122: tmp = t_1 elif t <= -290000000.0: tmp = (z / (t + (y + x))) * (y + x) elif t <= 6e+161: tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t / Float64(t + x)) * a) tmp = 0.0 if (t <= -6.2e+122) tmp = t_1; elseif (t <= -290000000.0) tmp = Float64(Float64(z / Float64(t + Float64(y + x))) * Float64(y + x)); elseif (t <= 6e+161) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t / (t + x)) * a; tmp = 0.0; if (t <= -6.2e+122) tmp = t_1; elseif (t <= -290000000.0) tmp = (z / (t + (y + x))) * (y + x); elseif (t <= 6e+161) tmp = (a + z) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -6.2e+122], t$95$1, If[LessEqual[t, -290000000.0], N[(N[(z / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+161], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{t + x} \cdot a\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -290000000:\\
\;\;\;\;\frac{z}{t + \left(y + x\right)} \cdot \left(y + x\right)\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+161}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.19999999999999998e122 or 6.00000000000000023e161 < t Initial program 53.4%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6451.9
Applied rewrites51.9%
Taylor expanded in y around 0
Applied rewrites58.4%
if -6.19999999999999998e122 < t < -2.9e8Initial program 67.6%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6463.7
Applied rewrites63.7%
if -2.9e8 < t < 6.00000000000000023e161Initial program 66.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
Final simplification61.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (/ t (+ t x)) a))) (if (<= t -6.7e+115) t_1 (if (<= t 6e+161) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t / (t + x)) * a;
double tmp;
if (t <= -6.7e+115) {
tmp = t_1;
} else if (t <= 6e+161) {
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 = (t / (t + x)) * a
if (t <= (-6.7d+115)) then
tmp = t_1
else if (t <= 6d+161) 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 = (t / (t + x)) * a;
double tmp;
if (t <= -6.7e+115) {
tmp = t_1;
} else if (t <= 6e+161) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t / (t + x)) * a tmp = 0 if t <= -6.7e+115: tmp = t_1 elif t <= 6e+161: tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t / Float64(t + x)) * a) tmp = 0.0 if (t <= -6.7e+115) tmp = t_1; elseif (t <= 6e+161) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t / (t + x)) * a; tmp = 0.0; if (t <= -6.7e+115) tmp = t_1; elseif (t <= 6e+161) tmp = (a + z) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -6.7e+115], t$95$1, If[LessEqual[t, 6e+161], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{t + x} \cdot a\\
\mathbf{if}\;t \leq -6.7 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+161}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.6999999999999997e115 or 6.00000000000000023e161 < t Initial program 54.5%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6450.7
Applied rewrites50.7%
Taylor expanded in y around 0
Applied rewrites57.0%
if -6.6999999999999997e115 < t < 6.00000000000000023e161Initial program 65.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6460.8
Applied rewrites60.8%
Final simplification59.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ a z) b))) (if (<= y -32000.0) t_1 (if (<= y 215000000000.0) (+ a z) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -32000.0) {
tmp = t_1;
} else if (y <= 215000000000.0) {
tmp = a + z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a + z) - b
if (y <= (-32000.0d0)) then
tmp = t_1
else if (y <= 215000000000.0d0) then
tmp = a + z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -32000.0) {
tmp = t_1;
} else if (y <= 215000000000.0) {
tmp = a + z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -32000.0: tmp = t_1 elif y <= 215000000000.0: tmp = a + z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -32000.0) tmp = t_1; elseif (y <= 215000000000.0) tmp = Float64(a + z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -32000.0) tmp = t_1; elseif (y <= 215000000000.0) tmp = a + z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -32000.0], t$95$1, If[LessEqual[y, 215000000000.0], N[(a + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -32000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 215000000000:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -32000 or 2.15e11 < y Initial program 45.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6466.8
Applied rewrites66.8%
if -32000 < y < 2.15e11Initial program 76.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6440.0
Applied rewrites40.0%
Taylor expanded in b around inf
Applied rewrites4.9%
Taylor expanded in b around 0
Applied rewrites50.3%
Final simplification57.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t 3.3e+119) (+ a z) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 3.3e+119) {
tmp = a + z;
} 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 (t <= 3.3d+119) then
tmp = a + z
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 (t <= 3.3e+119) {
tmp = a + z;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= 3.3e+119: tmp = a + z else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 3.3e+119) tmp = Float64(a + z); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= 3.3e+119) tmp = a + z; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 3.3e+119], N[(a + z), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.3 \cdot 10^{+119}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if t < 3.3000000000000002e119Initial program 64.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.9
Applied rewrites54.9%
Taylor expanded in b around inf
Applied rewrites10.9%
Taylor expanded in b around 0
Applied rewrites54.5%
if 3.3000000000000002e119 < t Initial program 50.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6439.8
Applied rewrites39.8%
Taylor expanded in z around 0
Applied rewrites43.8%
Final simplification52.7%
(FPCore (x y z t a b) :precision binary64 (+ a z))
double code(double x, double y, double z, double t, double a, double b) {
return a + z;
}
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 + z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a + z;
}
def code(x, y, z, t, a, b): return a + z
function code(x, y, z, t, a, b) return Float64(a + z) end
function tmp = code(x, y, z, t, a, b) tmp = a + z; end
code[x_, y_, z_, t_, a_, b_] := N[(a + z), $MachinePrecision]
\begin{array}{l}
\\
a + z
\end{array}
Initial program 62.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6452.4
Applied rewrites52.4%
Taylor expanded in b around inf
Applied rewrites11.1%
Taylor expanded in b around 0
Applied rewrites50.5%
Final simplification50.5%
(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 62.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6452.4
Applied rewrites52.4%
Taylor expanded in b around inf
Applied rewrites11.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024295
(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)))