
(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 15 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 (* (+ x y) (+ x y)))
(t_2 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t)))))
(if (<= t_2 -1e+234)
(fma (- z b) (/ y (+ y t)) a)
(if (<= t_2 2e+246)
t_2
(-
(fma
t
(- (fma y (/ b t_1) (/ a (+ x y))) (fma a (/ y t_1) (/ z (+ x y))))
(fma a (/ y (+ x y)) z))
(* y (/ b (+ x y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) * (x + y);
double t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if (t_2 <= -1e+234) {
tmp = fma((z - b), (y / (y + t)), a);
} else if (t_2 <= 2e+246) {
tmp = t_2;
} else {
tmp = fma(t, (fma(y, (b / t_1), (a / (x + y))) - fma(a, (y / t_1), (z / (x + y)))), fma(a, (y / (x + y)), z)) - (y * (b / (x + y)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) * Float64(x + y)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_2 <= -1e+234) tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a); elseif (t_2 <= 2e+246) tmp = t_2; else tmp = Float64(fma(t, Float64(fma(y, Float64(b / t_1), Float64(a / Float64(x + y))) - fma(a, Float64(y / t_1), Float64(z / Float64(x + y)))), fma(a, Float64(y / Float64(x + y)), z)) - Float64(y * Float64(b / Float64(x + y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] * N[(x + y), $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] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+234], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$2, 2e+246], t$95$2, N[(N[(t * N[(N[(y * N[(b / t$95$1), $MachinePrecision] + N[(a / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t$95$1), $MachinePrecision] + N[(z / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) \cdot \left(x + y\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+234}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+246}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t\_1}, \frac{a}{x + y}\right) - \mathsf{fma}\left(a, \frac{y}{t\_1}, \frac{z}{x + y}\right), \mathsf{fma}\left(a, \frac{y}{x + y}, z\right)\right) - y \cdot \frac{b}{x + y}\\
\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.00000000000000002e234Initial program 11.9%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites45.3%
Taylor expanded in x around 0
Applied rewrites77.7%
Applied rewrites78.0%
if -1.00000000000000002e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000014e246Initial program 99.0%
if 2.00000000000000014e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites82.0%
Final simplification91.0%
(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)))
(if (<= t_2 -1e+212)
(fma (- z b) (/ y (+ y t)) a)
(if (<= t_2 1e-66)
(/ (- (fma a t (* x z)) (* y b)) t_1)
(if (<= t_2 2e+246)
(/ (fma a t (* y (- (+ z a) b))) t_1)
(fma (+ y t) (/ a (+ t (+ x y))) (- z b)))))))
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 tmp;
if (t_2 <= -1e+212) {
tmp = fma((z - b), (y / (y + t)), a);
} else if (t_2 <= 1e-66) {
tmp = (fma(a, t, (x * z)) - (y * b)) / t_1;
} else if (t_2 <= 2e+246) {
tmp = fma(a, t, (y * ((z + a) - b))) / t_1;
} else {
tmp = fma((y + t), (a / (t + (x + y))), (z - b));
}
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) tmp = 0.0 if (t_2 <= -1e+212) tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a); elseif (t_2 <= 1e-66) tmp = Float64(Float64(fma(a, t, Float64(x * z)) - Float64(y * b)) / t_1); elseif (t_2 <= 2e+246) tmp = Float64(fma(a, t, Float64(y * Float64(Float64(z + a) - b))) / t_1); else tmp = fma(Float64(y + t), Float64(a / Float64(t + Float64(x + y))), Float64(z - b)); 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]}, If[LessEqual[t$95$2, -1e+212], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$2, 1e-66], N[(N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+246], N[(N[(a * t + N[(y * N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(y + t), $MachinePrecision] * N[(a / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]]]
\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}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+212}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\
\mathbf{elif}\;t\_2 \leq 10^{-66}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right) - y \cdot b}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+246}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, y \cdot \left(\left(z + a\right) - b\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + t, \frac{a}{t + \left(x + y\right)}, z - b\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999991e211Initial program 18.4%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites49.4%
Taylor expanded in x around 0
Applied rewrites77.7%
Applied rewrites78.0%
if -9.9999999999999991e211 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999998e-67Initial program 98.6%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6484.1
Applied rewrites84.1%
if 9.9999999999999998e-67 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000014e246Initial program 99.7%
Taylor expanded in x around 0
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
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6487.6
Applied rewrites87.6%
if 2.00000000000000014e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites38.8%
Taylor expanded in y around inf
Applied rewrites79.4%
Final simplification82.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t)))))
(if (<= t_1 -1e+234)
(fma (- z b) (/ y (+ y t)) a)
(if (<= t_1 2e+246) t_1 (fma (+ y t) (/ a (+ t (+ x y))) (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -1e+234) {
tmp = fma((z - b), (y / (y + t)), a);
} else if (t_1 <= 2e+246) {
tmp = t_1;
} else {
tmp = fma((y + t), (a / (t + (x + y))), (z - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_1 <= -1e+234) tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a); elseif (t_1 <= 2e+246) tmp = t_1; else tmp = fma(Float64(y + t), Float64(a / Float64(t + Float64(x + y))), Float64(z - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+234], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$1, 2e+246], t$95$1, N[(N[(y + t), $MachinePrecision] * N[(a / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+234}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+246}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + t, \frac{a}{t + \left(x + y\right)}, z - b\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.00000000000000002e234Initial program 11.9%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites45.3%
Taylor expanded in x around 0
Applied rewrites77.7%
Applied rewrites78.0%
if -1.00000000000000002e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000014e246Initial program 99.0%
if 2.00000000000000014e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites38.8%
Taylor expanded in y around inf
Applied rewrites79.4%
Final simplification90.3%
(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)))
(if (<= t_2 -5e+168)
(fma (- z b) (/ y (+ y t)) a)
(if (<= t_2 2e+246)
(/ (fma a t (* y (- (+ z a) b))) t_1)
(fma (+ y t) (/ a (+ t (+ x y))) (- z b))))))
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 tmp;
if (t_2 <= -5e+168) {
tmp = fma((z - b), (y / (y + t)), a);
} else if (t_2 <= 2e+246) {
tmp = fma(a, t, (y * ((z + a) - b))) / t_1;
} else {
tmp = fma((y + t), (a / (t + (x + y))), (z - b));
}
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) tmp = 0.0 if (t_2 <= -5e+168) tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a); elseif (t_2 <= 2e+246) tmp = Float64(fma(a, t, Float64(y * Float64(Float64(z + a) - b))) / t_1); else tmp = fma(Float64(y + t), Float64(a / Float64(t + Float64(x + y))), Float64(z - b)); 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]}, If[LessEqual[t$95$2, -5e+168], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$2, 2e+246], N[(N[(a * t + N[(y * N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(y + t), $MachinePrecision] * N[(a / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]]
\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}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+246}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, y \cdot \left(\left(z + a\right) - b\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + t, \frac{a}{t + \left(x + y\right)}, z - b\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.99999999999999967e168Initial program 25.3%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites53.6%
Taylor expanded in x around 0
Applied rewrites74.7%
Applied rewrites76.5%
if -4.99999999999999967e168 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000014e246Initial program 99.0%
Taylor expanded in x around 0
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
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6475.9
Applied rewrites75.9%
if 2.00000000000000014e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites38.8%
Taylor expanded in y around inf
Applied rewrites79.4%
Final simplification76.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -8e-34)
t_1
(if (<= y -1e-74)
(fma (- z b) (/ y t) a)
(if (<= y 5.5e-11) (* a (/ t (+ 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 <= -8e-34) {
tmp = t_1;
} else if (y <= -1e-74) {
tmp = fma((z - b), (y / t), a);
} else if (y <= 5.5e-11) {
tmp = a * (t / (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 <= -8e-34) tmp = t_1; elseif (y <= -1e-74) tmp = fma(Float64(z - b), Float64(y / t), a); elseif (y <= 5.5e-11) tmp = Float64(a * Float64(t / 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, -8e-34], t$95$1, If[LessEqual[y, -1e-74], N[(N[(z - b), $MachinePrecision] * N[(y / t), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[y, 5.5e-11], N[(a * N[(t / 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 -8 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-74}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{t}, a\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-11}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.99999999999999942e-34 or 5.49999999999999975e-11 < y Initial program 43.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6472.8
Applied rewrites72.8%
if -7.99999999999999942e-34 < y < -9.99999999999999958e-75Initial program 99.6%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
Applied rewrites75.5%
Applied rewrites75.5%
Taylor expanded in y around 0
Applied rewrites74.8%
if -9.99999999999999958e-75 < y < 5.49999999999999975e-11Initial program 77.6%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites78.3%
Taylor expanded in y around 0
Applied rewrites71.7%
Taylor expanded in a around inf
Applied rewrites48.1%
Final simplification61.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- z b) (/ y (+ y t)) a)))
(if (<= y -4.5e-188)
t_1
(if (<= y 1.25e-254) (/ (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 = fma((z - b), (y / (y + t)), a);
double tmp;
if (y <= -4.5e-188) {
tmp = t_1;
} else if (y <= 1.25e-254) {
tmp = fma(a, t, (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(z - b), Float64(y / Float64(y + t)), a) tmp = 0.0 if (y <= -4.5e-188) tmp = t_1; elseif (y <= 1.25e-254) 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 - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[y, -4.5e-188], t$95$1, If[LessEqual[y, 1.25e-254], 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 := \mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-254}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.49999999999999993e-188 or 1.2500000000000001e-254 < y Initial program 56.1%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites68.3%
Taylor expanded in x around 0
Applied rewrites72.3%
Applied rewrites74.3%
if -4.49999999999999993e-188 < y < 1.2500000000000001e-254Initial program 82.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6473.7
Applied rewrites73.7%
Final simplification74.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.1e+146) (+ z a) (if (<= x 3.2e+153) (fma y (/ (- z b) (+ y t)) a) (+ z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.1e+146) {
tmp = z + a;
} else if (x <= 3.2e+153) {
tmp = fma(y, ((z - b) / (y + t)), a);
} else {
tmp = z + a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.1e+146) tmp = Float64(z + a); elseif (x <= 3.2e+153) tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); else tmp = Float64(z + a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.1e+146], N[(z + a), $MachinePrecision], If[LessEqual[x, 3.2e+153], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(z + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+146}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if x < -1.0999999999999999e146 or 3.2000000000000001e153 < x Initial program 46.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6438.0
Applied rewrites38.0%
Taylor expanded in b around 0
Applied rewrites49.7%
if -1.0999999999999999e146 < x < 3.2000000000000001e153Initial program 64.8%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.1%
Taylor expanded in x around 0
Applied rewrites77.4%
Final simplification71.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.8e+78) (fma y (/ (- z b) t) a) (if (<= t 1.3e+65) (- (+ z a) b) (- a (/ (* x (- z)) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.8e+78) {
tmp = fma(y, ((z - b) / t), a);
} else if (t <= 1.3e+65) {
tmp = (z + a) - b;
} else {
tmp = a - ((x * -z) / t);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.8e+78) tmp = fma(y, Float64(Float64(z - b) / t), a); elseif (t <= 1.3e+65) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a - Float64(Float64(x * Float64(-z)) / t)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.8e+78], N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 1.3e+65], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(N[(x * (-z)), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+65}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{x \cdot \left(-z\right)}{t}\\
\end{array}
\end{array}
if t < -4.7999999999999997e78Initial program 59.0%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites64.8%
Taylor expanded in x around 0
Applied rewrites70.4%
if -4.7999999999999997e78 < t < 1.30000000000000001e65Initial program 64.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.7
Applied rewrites58.7%
if 1.30000000000000001e65 < t Initial program 49.8%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites53.0%
Taylor expanded in b around inf
Applied rewrites54.3%
Taylor expanded in z around -inf
Applied rewrites63.0%
Taylor expanded in y around 0
Applied rewrites56.5%
Final simplification61.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.8e+78) (fma y (/ (- z b) t) a) (if (<= t 7.8e+64) (- (+ z a) b) (- a (/ (* y b) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.8e+78) {
tmp = fma(y, ((z - b) / t), a);
} else if (t <= 7.8e+64) {
tmp = (z + a) - b;
} else {
tmp = a - ((y * b) / t);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.8e+78) tmp = fma(y, Float64(Float64(z - b) / t), a); elseif (t <= 7.8e+64) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a - Float64(Float64(y * b) / t)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.8e+78], N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 7.8e+64], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+64}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\end{array}
\end{array}
if t < -4.7999999999999997e78Initial program 59.0%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites64.8%
Taylor expanded in x around 0
Applied rewrites70.4%
if -4.7999999999999997e78 < t < 7.7999999999999996e64Initial program 64.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.7
Applied rewrites58.7%
if 7.7999999999999996e64 < t Initial program 49.8%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites53.0%
Taylor expanded in b around inf
Applied rewrites54.3%
Final simplification60.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ z a) b))) (if (<= y -9.6e-63) t_1 (if (<= y 5.5e-11) (* a (/ t (+ 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 <= -9.6e-63) {
tmp = t_1;
} else if (y <= 5.5e-11) {
tmp = a * (t / (x + t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-9.6d-63)) then
tmp = t_1
else if (y <= 5.5d-11) then
tmp = a * (t / (x + t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -9.6e-63) {
tmp = t_1;
} else if (y <= 5.5e-11) {
tmp = a * (t / (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -9.6e-63: tmp = t_1 elif y <= 5.5e-11: tmp = a * (t / (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 <= -9.6e-63) tmp = t_1; elseif (y <= 5.5e-11) tmp = Float64(a * Float64(t / Float64(x + t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -9.6e-63) tmp = t_1; elseif (y <= 5.5e-11) tmp = a * (t / (x + t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -9.6e-63], t$95$1, If[LessEqual[y, 5.5e-11], N[(a * N[(t / 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 -9.6 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-11}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.6000000000000002e-63 or 5.49999999999999975e-11 < y Initial program 45.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6471.0
Applied rewrites71.0%
if -9.6000000000000002e-63 < y < 5.49999999999999975e-11Initial program 78.2%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites78.8%
Taylor expanded in y around 0
Applied rewrites70.9%
Taylor expanded in a around inf
Applied rewrites46.9%
Final simplification59.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x 9.4e+185) (fma (- z b) (/ y (+ y t)) a) (* (- b) (/ z (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 9.4e+185) {
tmp = fma((z - b), (y / (y + t)), a);
} else {
tmp = -b * (z / -b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 9.4e+185) tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a); else tmp = Float64(Float64(-b) * Float64(z / Float64(-b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 9.4e+185], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[((-b) * N[(z / (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.4 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \frac{z}{-b}\\
\end{array}
\end{array}
if x < 9.39999999999999945e185Initial program 63.5%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites71.8%
Taylor expanded in x around 0
Applied rewrites70.7%
Applied rewrites72.9%
if 9.39999999999999945e185 < x Initial program 34.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6438.8
Applied rewrites38.8%
Taylor expanded in b around -inf
Applied rewrites34.8%
Taylor expanded in z around inf
Applied rewrites57.3%
Final simplification71.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ z a) b))) (if (<= y -9.5e+36) t_1 (if (<= y 1.22e+14) (+ z a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -9.5e+36) {
tmp = t_1;
} else if (y <= 1.22e+14) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-9.5d+36)) then
tmp = t_1
else if (y <= 1.22d+14) then
tmp = z + a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -9.5e+36) {
tmp = t_1;
} else if (y <= 1.22e+14) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -9.5e+36: tmp = t_1 elif y <= 1.22e+14: tmp = z + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -9.5e+36) tmp = t_1; elseif (y <= 1.22e+14) tmp = Float64(z + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -9.5e+36) tmp = t_1; elseif (y <= 1.22e+14) tmp = z + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -9.5e+36], t$95$1, If[LessEqual[y, 1.22e+14], N[(z + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+14}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.49999999999999974e36 or 1.22e14 < y Initial program 40.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6474.1
Applied rewrites74.1%
if -9.49999999999999974e36 < y < 1.22e14Initial program 78.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6430.9
Applied rewrites30.9%
Taylor expanded in b around 0
Applied rewrites42.8%
Final simplification57.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.5e+253) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.5e+253) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 6.5d+253) then
tmp = z + a
else
tmp = a - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.5e+253) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.5e+253: tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.5e+253) tmp = Float64(z + a); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6.5e+253) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.5e+253], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.5 \cdot 10^{+253}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if y < 6.5000000000000002e253Initial program 62.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6449.4
Applied rewrites49.4%
Taylor expanded in b around 0
Applied rewrites49.7%
if 6.5000000000000002e253 < y Initial program 13.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6491.2
Applied rewrites91.2%
Taylor expanded in z around 0
Applied rewrites91.2%
Final simplification51.3%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6451.0
Applied rewrites51.0%
Taylor expanded in b around 0
Applied rewrites49.4%
Final simplification49.4%
(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 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6451.0
Applied rewrites51.0%
Taylor expanded in b around inf
Applied rewrites12.5%
(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 2024221
(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)))