
(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 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1)))
(if (<= t_2 -1e+296)
(- (+ z a) (* y (/ b (+ (+ t x) y))))
(if (<= t_2 1e+269)
(/ (fma (- (+ a z) b) y (fma a t (* z x))) t_1)
(- (+ z a) (/ y (/ t_1 b)))))))
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)) / t_1;
double tmp;
if (t_2 <= -1e+296) {
tmp = (z + a) - (y * (b / ((t + x) + y)));
} else if (t_2 <= 1e+269) {
tmp = fma(((a + z) - b), y, fma(a, t, (z * x))) / t_1;
} else {
tmp = (z + a) - (y / (t_1 / b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= -1e+296) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); elseif (t_2 <= 1e+269) tmp = Float64(fma(Float64(Float64(a + z) - b), y, fma(a, t, Float64(z * x))) / t_1); else tmp = Float64(Float64(z + a) - Float64(y / Float64(t_1 / b))); end return 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+296], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+269], N[(N[(N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision] * y + N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - N[(y / N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+296}:\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{elif}\;t\_2 \leq 10^{+269}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(a + z\right) - b, y, \mathsf{fma}\left(a, t, z \cdot x\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - \frac{y}{\frac{t\_1}{b}}\\
\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.99999999999999981e295Initial program 11.0%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites22.7%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6484.6
Applied rewrites84.6%
if -9.99999999999999981e295 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e269Initial program 98.5%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6498.6
Applied rewrites98.6%
if 1e269 < (/.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
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites11.7%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6485.2
Applied rewrites85.2%
lift-+.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
unsub-negN/A
lower--.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Final simplification93.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_4 (- (+ z a) (* y (/ b (+ (+ t x) y))))))
(if (<= t_3 -2e+273)
t_4
(if (<= t_3 -2e+134)
(/ (fma z x (* y (- z b))) t_2)
(if (<= t_3 -1e-195)
(/ (- t_1 (* y b)) t_2)
(if (<= t_3 10.0) (/ (fma a t (* z x)) (+ t x)) t_4))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = (z + a) - (y * (b / ((t + x) + y)));
double tmp;
if (t_3 <= -2e+273) {
tmp = t_4;
} else if (t_3 <= -2e+134) {
tmp = fma(z, x, (y * (z - b))) / t_2;
} else if (t_3 <= -1e-195) {
tmp = (t_1 - (y * b)) / t_2;
} else if (t_3 <= 10.0) {
tmp = fma(a, t, (z * x)) / (t + x);
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))) tmp = 0.0 if (t_3 <= -2e+273) tmp = t_4; elseif (t_3 <= -2e+134) tmp = Float64(fma(z, x, Float64(y * Float64(z - b))) / t_2); elseif (t_3 <= -1e-195) tmp = Float64(Float64(t_1 - Float64(y * b)) / t_2); elseif (t_3 <= 10.0) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+273], t$95$4, If[LessEqual[t$95$3, -2e+134], N[(N[(z * x + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, -1e-195], N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 10.0], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := \left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+273}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+134}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)}{t\_2}\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-195}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 10:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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.99999999999999989e273 or 10 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 33.2%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites38.7%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6479.0
Applied rewrites79.0%
if -1.99999999999999989e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999984e134Initial 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--.f6478.2
Applied rewrites78.2%
if -1.99999999999999984e134 < (/.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.6%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-+.f6477.1
Applied rewrites77.1%
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)) < 10Initial program 95.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6473.2
Applied rewrites73.2%
Final simplification77.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- z b)))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_2))
(t_4 (- (+ z a) (* y (/ b (+ (+ t x) y))))))
(if (<= t_3 -2e+273)
t_4
(if (<= t_3 -5e+171)
(/ (fma z x t_1) t_2)
(if (<= t_3 -2e-161)
(/ (fma (+ t y) a t_1) (+ t y))
(if (<= t_3 10.0) (/ (fma a t (* z x)) (+ t x)) t_4))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (z - b);
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_2;
double t_4 = (z + a) - (y * (b / ((t + x) + y)));
double tmp;
if (t_3 <= -2e+273) {
tmp = t_4;
} else if (t_3 <= -5e+171) {
tmp = fma(z, x, t_1) / t_2;
} else if (t_3 <= -2e-161) {
tmp = fma((t + y), a, t_1) / (t + y);
} else if (t_3 <= 10.0) {
tmp = fma(a, t, (z * x)) / (t + x);
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(z - b)) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_2) t_4 = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))) tmp = 0.0 if (t_3 <= -2e+273) tmp = t_4; elseif (t_3 <= -5e+171) tmp = Float64(fma(z, x, t_1) / t_2); elseif (t_3 <= -2e-161) tmp = Float64(fma(Float64(t + y), a, t_1) / Float64(t + y)); elseif (t_3 <= 10.0) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+273], t$95$4, If[LessEqual[t$95$3, -5e+171], N[(N[(z * x + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, -2e-161], N[(N[(N[(t + y), $MachinePrecision] * a + t$95$1), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 10.0], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - b\right)\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_2}\\
t_4 := \left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+273}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+171}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, x, t\_1\right)}{t\_2}\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-161}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, t\_1\right)}{t + y}\\
\mathbf{elif}\;t\_3 \leq 10:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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.99999999999999989e273 or 10 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 33.2%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites38.7%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6479.0
Applied rewrites79.0%
if -1.99999999999999989e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.0000000000000004e171Initial 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--.f6482.8
Applied rewrites82.8%
if -5.0000000000000004e171 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.00000000000000006e-161Initial 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-+.f6471.8
Applied rewrites71.8%
if -2.00000000000000006e-161 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 10Initial program 95.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6472.2
Applied rewrites72.2%
Final simplification76.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (- (+ z a) (* y (/ b (+ (+ t x) y))))))
(if (<= t_1 -2e+134)
t_2
(if (<= t_1 -2e-161)
(/ (fma (+ t y) a (* y (- z b))) (+ t y))
(if (<= t_1 10.0) (/ (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 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double t_2 = (z + a) - (y * (b / ((t + x) + y)));
double tmp;
if (t_1 <= -2e+134) {
tmp = t_2;
} else if (t_1 <= -2e-161) {
tmp = fma((t + y), a, (y * (z - b))) / (t + y);
} else if (t_1 <= 10.0) {
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(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_2 = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))) tmp = 0.0 if (t_1 <= -2e+134) tmp = t_2; elseif (t_1 <= -2e-161) tmp = Float64(fma(Float64(t + y), a, Float64(y * Float64(z - b))) / Float64(t + y)); elseif (t_1 <= 10.0) 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[(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]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+134], t$95$2, If[LessEqual[t$95$1, -2e-161], N[(N[(N[(t + y), $MachinePrecision] * a + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10.0], 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(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
t_2 := \left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+134}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-161}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, y \cdot \left(z - b\right)\right)}{t + y}\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;\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)) < -1.99999999999999984e134 or 10 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 41.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites45.3%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6476.2
Applied rewrites76.2%
if -1.99999999999999984e134 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.00000000000000006e-161Initial 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-+.f6471.6
Applied rewrites71.6%
if -2.00000000000000006e-161 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 10Initial program 95.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6472.2
Applied rewrites72.2%
Final simplification74.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_1))
(t_3 (- (+ z a) (* y (/ b (+ (+ t x) y))))))
(if (<= t_2 -5e+71)
t_3
(if (<= t_2 -1e-195)
(/ (- (* a t) (* y b)) t_1)
(if (<= t_2 10.0) (/ (fma a t (* z x)) (+ t x)) t_3)))))
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)) / t_1;
double t_3 = (z + a) - (y * (b / ((t + x) + y)));
double tmp;
if (t_2 <= -5e+71) {
tmp = t_3;
} else if (t_2 <= -1e-195) {
tmp = ((a * t) - (y * b)) / t_1;
} else if (t_2 <= 10.0) {
tmp = fma(a, t, (z * x)) / (t + x);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))) tmp = 0.0 if (t_2 <= -5e+71) tmp = t_3; elseif (t_2 <= -1e-195) tmp = Float64(Float64(Float64(a * t) - Float64(y * b)) / t_1); elseif (t_2 <= 10.0) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); else tmp = t_3; end return 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+71], t$95$3, If[LessEqual[t$95$2, -1e-195], N[(N[(N[(a * t), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 10.0], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+71}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-195}:\\
\;\;\;\;\frac{a \cdot t - y \cdot b}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 10:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\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)) < -4.99999999999999972e71 or 10 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 46.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites49.5%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6474.7
Applied rewrites74.7%
if -4.99999999999999972e71 < (/.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.6%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-+.f6483.7
Applied rewrites83.7%
Taylor expanded in y around 0
Applied rewrites74.0%
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)) < 10Initial program 95.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6473.2
Applied rewrites73.2%
Final simplification74.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1))
(t_3 (- (+ a z) b)))
(if (<= t_2 -4e+76)
t_3
(if (<= t_2 10.0)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 1e+210) (/ (* t_3 y) t_1) t_3)))))
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)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -4e+76) {
tmp = t_3;
} else if (t_2 <= 10.0) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 1e+210) {
tmp = (t_3 * y) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= -4e+76) tmp = t_3; elseif (t_2 <= 10.0) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 1e+210) 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[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+76], t$95$3, If[LessEqual[t$95$2, 10.0], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+210], N[(N[(t$95$3 * y), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+76}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 10^{+210}:\\
\;\;\;\;\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)) < -4.0000000000000002e76 or 9.99999999999999927e209 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 34.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6467.8
Applied rewrites67.8%
if -4.0000000000000002e76 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 10Initial program 97.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6468.1
Applied rewrites68.1%
if 10 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999927e209Initial program 99.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6469.4
Applied rewrites69.4%
(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_1))
(t_3 (- (+ a z) b)))
(if (<= t_2 -2e+41)
t_3
(if (<= t_2 1e-69)
(/ (* (+ y t) a) t_1)
(if (<= t_2 1e+44) (* (+ y x) (/ z (+ (+ y x) t))) t_3)))))
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)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -2e+41) {
tmp = t_3;
} else if (t_2 <= 1e-69) {
tmp = ((y + t) * a) / t_1;
} else if (t_2 <= 1e+44) {
tmp = (y + x) * (z / ((y + x) + t));
} else {
tmp = t_3;
}
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) :: tmp
t_1 = (x + t) + y
t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1
t_3 = (a + z) - b
if (t_2 <= (-2d+41)) then
tmp = t_3
else if (t_2 <= 1d-69) then
tmp = ((y + t) * a) / t_1
else if (t_2 <= 1d+44) then
tmp = (y + x) * (z / ((y + x) + t))
else
tmp = t_3
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)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -2e+41) {
tmp = t_3;
} else if (t_2 <= 1e-69) {
tmp = ((y + t) * a) / t_1;
} else if (t_2 <= 1e+44) {
tmp = (y + x) * (z / ((y + x) + t));
} else {
tmp = t_3;
}
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_1 t_3 = (a + z) - b tmp = 0 if t_2 <= -2e+41: tmp = t_3 elif t_2 <= 1e-69: tmp = ((y + t) * a) / t_1 elif t_2 <= 1e+44: tmp = (y + x) * (z / ((y + x) + t)) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= -2e+41) tmp = t_3; elseif (t_2 <= 1e-69) tmp = Float64(Float64(Float64(y + t) * a) / t_1); elseif (t_2 <= 1e+44) tmp = Float64(Float64(y + x) * Float64(z / Float64(Float64(y + x) + t))); else tmp = t_3; 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_1; t_3 = (a + z) - b; tmp = 0.0; if (t_2 <= -2e+41) tmp = t_3; elseif (t_2 <= 1e-69) tmp = ((y + t) * a) / t_1; elseif (t_2 <= 1e+44) tmp = (y + x) * (z / ((y + x) + t)); else tmp = t_3; 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+41], t$95$3, If[LessEqual[t$95$2, 1e-69], N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+44], N[(N[(y + x), $MachinePrecision] * N[(z / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+41}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-69}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 10^{+44}:\\
\;\;\;\;\left(y + x\right) \cdot \frac{z}{\left(y + x\right) + t}\\
\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.00000000000000001e41 or 1.0000000000000001e44 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 44.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6464.0
Applied rewrites64.0%
if -2.00000000000000001e41 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999996e-70Initial program 96.8%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites95.3%
Taylor expanded in a around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6451.9
Applied rewrites51.9%
if 9.9999999999999996e-70 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e44Initial program 99.8%
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-+.f6455.2
Applied rewrites55.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (/ (- (+ (* (+ x y) z) t_1) (* y b)) (+ (+ x t) y))))
(if (or (<= t_2 -4e+213) (not (<= t_2 5e+37)))
(- (+ z a) (* y (/ b (+ (+ t x) y))))
(/ (fma (+ y x) z t_1) (+ (+ y x) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = ((((x + y) * z) + t_1) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_2 <= -4e+213) || !(t_2 <= 5e+37)) {
tmp = (z + a) - (y * (b / ((t + x) + y)));
} else {
tmp = fma((y + x), z, t_1) / ((y + x) + t);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if ((t_2 <= -4e+213) || !(t_2 <= 5e+37)) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = Float64(fma(Float64(y + x), z, t_1) / Float64(Float64(y + x) + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -4e+213], N[Not[LessEqual[t$95$2, 5e+37]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+213} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+37}\right):\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right)}{\left(y + x\right) + t}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -3.99999999999999994e213 or 4.99999999999999989e37 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 31.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites36.0%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6479.3
Applied rewrites79.3%
if -3.99999999999999994e213 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.99999999999999989e37Initial program 98.2%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6483.1
Applied rewrites83.1%
Final simplification81.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (or (<= t_1 -4e+76) (not (<= t_1 10.0)))
(- (+ z a) (* y (/ b (+ (+ t x) y))))
(/ (fma a t (* z x)) (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_1 <= -4e+76) || !(t_1 <= 10.0)) {
tmp = (z + a) - (y * (b / ((t + x) + y)));
} else {
tmp = fma(a, t, (z * x)) / (t + x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if ((t_1 <= -4e+76) || !(t_1 <= 10.0)) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[Or[LessEqual[t$95$1, -4e+76], N[Not[LessEqual[t$95$1, 10.0]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+76} \lor \neg \left(t\_1 \leq 10\right):\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\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.0000000000000002e76 or 10 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 46.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites49.2%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6474.8
Applied rewrites74.8%
if -4.0000000000000002e76 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 10Initial program 97.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6468.1
Applied rewrites68.1%
Final simplification72.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -6.6e+104)
(- z (* t (/ z (+ x y))))
(if (<= x 8e+83)
(- (+ a z) b)
(if (<= x 3.2e+214)
(* (+ y x) (/ z (+ (+ y x) t)))
(- (+ z a) (* y (/ b x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.6e+104) {
tmp = z - (t * (z / (x + y)));
} else if (x <= 8e+83) {
tmp = (a + z) - b;
} else if (x <= 3.2e+214) {
tmp = (y + x) * (z / ((y + x) + t));
} else {
tmp = (z + a) - (y * (b / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.6d+104)) then
tmp = z - (t * (z / (x + y)))
else if (x <= 8d+83) then
tmp = (a + z) - b
else if (x <= 3.2d+214) then
tmp = (y + x) * (z / ((y + x) + t))
else
tmp = (z + a) - (y * (b / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.6e+104) {
tmp = z - (t * (z / (x + y)));
} else if (x <= 8e+83) {
tmp = (a + z) - b;
} else if (x <= 3.2e+214) {
tmp = (y + x) * (z / ((y + x) + t));
} else {
tmp = (z + a) - (y * (b / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.6e+104: tmp = z - (t * (z / (x + y))) elif x <= 8e+83: tmp = (a + z) - b elif x <= 3.2e+214: tmp = (y + x) * (z / ((y + x) + t)) else: tmp = (z + a) - (y * (b / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.6e+104) tmp = Float64(z - Float64(t * Float64(z / Float64(x + y)))); elseif (x <= 8e+83) tmp = Float64(Float64(a + z) - b); elseif (x <= 3.2e+214) tmp = Float64(Float64(y + x) * Float64(z / Float64(Float64(y + x) + t))); else tmp = Float64(Float64(z + a) - Float64(y * Float64(b / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.6e+104) tmp = z - (t * (z / (x + y))); elseif (x <= 8e+83) tmp = (a + z) - b; elseif (x <= 3.2e+214) tmp = (y + x) * (z / ((y + x) + t)); else tmp = (z + a) - (y * (b / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.6e+104], N[(z - N[(t * N[(z / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+83], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 3.2e+214], N[(N[(y + x), $MachinePrecision] * N[(z / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+104}:\\
\;\;\;\;z - t \cdot \frac{z}{x + y}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+83}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+214}:\\
\;\;\;\;\left(y + x\right) \cdot \frac{z}{\left(y + x\right) + t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{x}\\
\end{array}
\end{array}
if x < -6.59999999999999969e104Initial program 55.3%
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-+.f6452.2
Applied rewrites52.2%
Taylor expanded in y around inf
Applied rewrites7.9%
Taylor expanded in t around 0
Applied rewrites64.4%
if -6.59999999999999969e104 < x < 8.00000000000000025e83Initial program 68.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.9
Applied rewrites57.9%
if 8.00000000000000025e83 < x < 3.19999999999999995e214Initial program 61.5%
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-+.f6453.6
Applied rewrites53.6%
if 3.19999999999999995e214 < x Initial program 28.0%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites46.0%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6469.4
Applied rewrites69.4%
Taylor expanded in x around inf
lower-/.f6465.1
Applied rewrites65.1%
Final simplification58.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -6.2e-38)
t_1
(if (<= y 5.3e-113)
(/ (fma a t (* z x)) (+ t x))
(if (<= y 1.65e-18) (- (+ z a) (* y (/ b t))) 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 <= -6.2e-38) {
tmp = t_1;
} else if (y <= 5.3e-113) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (y <= 1.65e-18) {
tmp = (z + a) - (y * (b / t));
} 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 <= -6.2e-38) tmp = t_1; elseif (y <= 5.3e-113) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (y <= 1.65e-18) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.2e-38], t$95$1, If[LessEqual[y, 5.3e-113], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-18], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-113}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-18}:\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.19999999999999966e-38 or 1.6500000000000001e-18 < y Initial program 45.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6471.3
Applied rewrites71.3%
if -6.19999999999999966e-38 < y < 5.3000000000000004e-113Initial program 84.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6461.4
Applied rewrites61.4%
if 5.3000000000000004e-113 < y < 1.6500000000000001e-18Initial program 68.3%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites68.5%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6474.7
Applied rewrites74.7%
Taylor expanded in t around inf
lower-/.f6465.1
Applied rewrites65.1%
Final simplification66.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6.6e+104) (- z (* t (/ z (+ x y)))) (if (<= x 2.9e+140) (- (+ a z) b) (- (+ z a) (* y (/ b x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.6e+104) {
tmp = z - (t * (z / (x + y)));
} else if (x <= 2.9e+140) {
tmp = (a + z) - b;
} else {
tmp = (z + a) - (y * (b / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.6d+104)) then
tmp = z - (t * (z / (x + y)))
else if (x <= 2.9d+140) then
tmp = (a + z) - b
else
tmp = (z + a) - (y * (b / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.6e+104) {
tmp = z - (t * (z / (x + y)));
} else if (x <= 2.9e+140) {
tmp = (a + z) - b;
} else {
tmp = (z + a) - (y * (b / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.6e+104: tmp = z - (t * (z / (x + y))) elif x <= 2.9e+140: tmp = (a + z) - b else: tmp = (z + a) - (y * (b / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.6e+104) tmp = Float64(z - Float64(t * Float64(z / Float64(x + y)))); elseif (x <= 2.9e+140) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(z + a) - Float64(y * Float64(b / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.6e+104) tmp = z - (t * (z / (x + y))); elseif (x <= 2.9e+140) tmp = (a + z) - b; else tmp = (z + a) - (y * (b / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.6e+104], N[(z - N[(t * N[(z / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+140], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+104}:\\
\;\;\;\;z - t \cdot \frac{z}{x + y}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+140}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{x}\\
\end{array}
\end{array}
if x < -6.59999999999999969e104Initial program 55.3%
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-+.f6452.2
Applied rewrites52.2%
Taylor expanded in y around inf
Applied rewrites7.9%
Taylor expanded in t around 0
Applied rewrites64.4%
if -6.59999999999999969e104 < x < 2.8999999999999999e140Initial program 67.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
if 2.8999999999999999e140 < x Initial program 45.5%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites55.8%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6451.6
Applied rewrites51.6%
Taylor expanded in x around inf
lower-/.f6449.2
Applied rewrites49.2%
Final simplification56.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.2e+110) (not (<= t 4.4e+203))) (* a (/ t (+ x t))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.2e+110) || !(t <= 4.4e+203)) {
tmp = a * (t / (x + t));
} else {
tmp = (a + z) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-5.2d+110)) .or. (.not. (t <= 4.4d+203))) then
tmp = a * (t / (x + t))
else
tmp = (a + z) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.2e+110) || !(t <= 4.4e+203)) {
tmp = a * (t / (x + t));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.2e+110) or not (t <= 4.4e+203): tmp = a * (t / (x + t)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.2e+110) || !(t <= 4.4e+203)) tmp = Float64(a * Float64(t / Float64(x + t))); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.2e+110) || ~((t <= 4.4e+203))) tmp = a * (t / (x + t)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.2e+110], N[Not[LessEqual[t, 4.4e+203]], $MachinePrecision]], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+110} \lor \neg \left(t \leq 4.4 \cdot 10^{+203}\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -5.2e110 or 4.40000000000000009e203 < t Initial program 52.9%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.1%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6439.2
Applied rewrites39.2%
Taylor expanded in z around 0
Applied rewrites64.9%
if -5.2e110 < t < 4.40000000000000009e203Initial program 66.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.2
Applied rewrites54.2%
Final simplification56.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.42e+66) (- a (* a (/ x (+ y t)))) (if (<= t 4.4e+203) (- (+ a z) b) (* a (/ t (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.42e+66) {
tmp = a - (a * (x / (y + t)));
} else if (t <= 4.4e+203) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (x + t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.42d+66)) then
tmp = a - (a * (x / (y + t)))
else if (t <= 4.4d+203) then
tmp = (a + z) - b
else
tmp = a * (t / (x + t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.42e+66) {
tmp = a - (a * (x / (y + t)));
} else if (t <= 4.4e+203) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.42e+66: tmp = a - (a * (x / (y + t))) elif t <= 4.4e+203: tmp = (a + z) - b else: tmp = a * (t / (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.42e+66) tmp = Float64(a - Float64(a * Float64(x / Float64(y + t)))); elseif (t <= 4.4e+203) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a * Float64(t / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.42e+66) tmp = a - (a * (x / (y + t))); elseif (t <= 4.4e+203) tmp = (a + z) - b; else tmp = a * (t / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.42e+66], N[(a - N[(a * N[(x / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+203], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.42 \cdot 10^{+66}:\\
\;\;\;\;a - a \cdot \frac{x}{y + t}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+203}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\end{array}
\end{array}
if t < -1.4200000000000001e66Initial program 58.1%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites74.8%
Taylor expanded in a around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6433.1
Applied rewrites33.1%
Taylor expanded in x around 0
Applied rewrites53.7%
if -1.4200000000000001e66 < t < 4.40000000000000009e203Initial program 66.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.9
Applied rewrites55.9%
if 4.40000000000000009e203 < t Initial program 50.3%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites83.2%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6433.8
Applied rewrites33.8%
Taylor expanded in z around 0
Applied rewrites70.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.2e+111) (not (<= z 4.4e+210))) (- z b) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e+111) || !(z <= 4.4e+210)) {
tmp = z - b;
} 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 ((z <= (-3.2d+111)) .or. (.not. (z <= 4.4d+210))) then
tmp = z - b
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 ((z <= -3.2e+111) || !(z <= 4.4e+210)) {
tmp = z - b;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.2e+111) or not (z <= 4.4e+210): tmp = z - b else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.2e+111) || !(z <= 4.4e+210)) tmp = Float64(z - b); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.2e+111) || ~((z <= 4.4e+210))) tmp = z - b; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.2e+111], N[Not[LessEqual[z, 4.4e+210]], $MachinePrecision]], N[(z - b), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+111} \lor \neg \left(z \leq 4.4 \cdot 10^{+210}\right):\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if z < -3.2000000000000001e111 or 4.39999999999999974e210 < z Initial program 44.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.7
Applied rewrites58.7%
Taylor expanded in b around inf
Applied rewrites3.1%
Taylor expanded in a around 0
Applied rewrites53.1%
if -3.2000000000000001e111 < z < 4.39999999999999974e210Initial program 70.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6447.9
Applied rewrites47.9%
Taylor expanded in z around 0
Applied rewrites45.6%
Final simplification47.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.8e+91) (- a b) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.8e+91) {
tmp = a - b;
} else {
tmp = (a + z) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.8d+91)) then
tmp = a - b
else
tmp = (a + z) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.8e+91) {
tmp = a - b;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.8e+91: tmp = a - b else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.8e+91) tmp = Float64(a - b); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.8e+91) tmp = a - b; else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.8e+91], N[(a - b), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+91}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -1.8e91Initial program 56.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6438.3
Applied rewrites38.3%
Taylor expanded in z around 0
Applied rewrites54.3%
if -1.8e91 < t Initial program 64.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6453.1
Applied rewrites53.1%
(FPCore (x y z t a b) :precision binary64 (- a b))
double code(double x, double y, double z, double t, double a, double b) {
return a - 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 = a - b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a - b;
}
def code(x, y, z, t, a, b): return a - b
function code(x, y, z, t, a, b) return Float64(a - b) end
function tmp = code(x, y, z, t, a, b) tmp = a - b; end
code[x_, y_, z_, t_, a_, b_] := N[(a - b), $MachinePrecision]
\begin{array}{l}
\\
a - b
\end{array}
Initial program 63.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
Applied rewrites38.8%
(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 63.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in b around inf
Applied rewrites11.4%
(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 2024307
(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)))