
(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 17 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 (pow (+ t y) 2.0))
(t_2 (/ z (+ t y)))
(t_3 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (<= t_3 (- INFINITY))
(fma
(- b)
(/ y (+ t y))
(fma
(fma (/ y t_1) b (- t_2 (fma (/ z t_1) y (/ a (+ t y)))))
x
(fma t_2 y a)))
(if (<= t_3 4e+303) t_3 (- (+ a z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow((t + y), 2.0);
double t_2 = z / (t + y);
double t_3 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma(-b, (y / (t + y)), fma(fma((y / t_1), b, (t_2 - fma((z / t_1), y, (a / (t + y))))), x, fma(t_2, y, a)));
} else if (t_3 <= 4e+303) {
tmp = t_3;
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + y) ^ 2.0 t_2 = Float64(z / Float64(t + y)) t_3 = 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_3 <= Float64(-Inf)) tmp = fma(Float64(-b), Float64(y / Float64(t + y)), fma(fma(Float64(y / t_1), b, Float64(t_2 - fma(Float64(z / t_1), y, Float64(a / Float64(t + y))))), x, fma(t_2, y, a))); elseif (t_3 <= 4e+303) tmp = t_3; else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Power[N[(t + y), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(t + y), $MachinePrecision]), $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] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[((-b) * N[(y / N[(t + y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y / t$95$1), $MachinePrecision] * b + N[(t$95$2 - N[(N[(z / t$95$1), $MachinePrecision] * y + N[(a / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + N[(t$95$2 * y + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+303], t$95$3, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(t + y\right)}^{2}\\
t_2 := \frac{z}{t + y}\\
t_3 := \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\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(-b, \frac{y}{t + y}, \mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{t\_1}, b, t\_2 - \mathsf{fma}\left(\frac{z}{t\_1}, y, \frac{a}{t + y}\right)\right), x, \mathsf{fma}\left(t\_2, y, a\right)\right)\right)\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - 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)) < -inf.0Initial program 6.3%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites71.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e303Initial program 99.7%
if 4e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6478.4
Applied rewrites78.4%
(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 (/ (fma z x t_1) t_2)))
(if (<= t_3 -1e+130)
(fma y (/ (- z b) (+ t y)) a)
(if (<= t_3 -1000000000000.0)
t_4
(if (<= t_3 2e-64)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_3 2e+182)
t_4
(if (<= t_3 5e+267)
(/ (fma (+ t y) a t_1) (+ t y))
(- (+ a z) b))))))))
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 = fma(z, x, t_1) / t_2;
double tmp;
if (t_3 <= -1e+130) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else if (t_3 <= -1000000000000.0) {
tmp = t_4;
} else if (t_3 <= 2e-64) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_3 <= 2e+182) {
tmp = t_4;
} else if (t_3 <= 5e+267) {
tmp = fma((t + y), a, t_1) / (t + y);
} else {
tmp = (a + z) - b;
}
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(fma(z, x, t_1) / t_2) tmp = 0.0 if (t_3 <= -1e+130) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); elseif (t_3 <= -1000000000000.0) tmp = t_4; elseif (t_3 <= 2e-64) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_3 <= 2e+182) tmp = t_4; elseif (t_3 <= 5e+267) tmp = Float64(fma(Float64(t + y), a, t_1) / Float64(t + y)); else tmp = Float64(Float64(a + z) - b); 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 * x + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+130], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$3, -1000000000000.0], t$95$4, If[LessEqual[t$95$3, 2e-64], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+182], t$95$4, If[LessEqual[t$95$3, 5e+267], N[(N[(N[(t + y), $MachinePrecision] * a + t$95$1), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]]]]]]
\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 := \frac{\mathsf{fma}\left(z, x, t\_1\right)}{t\_2}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+130}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{elif}\;t\_3 \leq -1000000000000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+182}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, t\_1\right)}{t + y}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - 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)) < -1.0000000000000001e130Initial program 37.9%
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-+.f6431.4
Applied rewrites31.4%
Taylor expanded in a around 0
Applied rewrites69.6%
if -1.0000000000000001e130 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1e12 or 1.99999999999999993e-64 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e182Initial program 99.6%
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--.f6480.9
Applied rewrites80.9%
if -1e12 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999993e-64Initial program 99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6481.5
Applied rewrites81.5%
if 2.0000000000000001e182 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999999e267Initial program 99.8%
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-+.f6487.0
Applied rewrites87.0%
if 4.9999999999999999e267 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6478.6
Applied rewrites78.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (<= t_1 -2e+33)
(fma y (/ (- z b) (+ t y)) a)
(if (<= t_1 1e-128)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_1 5e+267)
(/ (fma (+ t y) a (* y (- z b))) (+ t y))
(- (+ a z) b))))))
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 <= -2e+33) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else if (t_1 <= 1e-128) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_1 <= 5e+267) {
tmp = fma((t + y), a, (y * (z - b))) / (t + y);
} else {
tmp = (a + z) - b;
}
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 <= -2e+33) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); elseif (t_1 <= 1e-128) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_1 <= 5e+267) tmp = Float64(fma(Float64(t + y), a, Float64(y * Float64(z - b))) / Float64(t + y)); else tmp = Float64(Float64(a + z) - b); 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[LessEqual[t$95$1, -2e+33], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$1, 1e-128], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+267], N[(N[(N[(t + y), $MachinePrecision] * a + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $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 -2 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-128}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, y \cdot \left(z - b\right)\right)}{t + y}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - 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)) < -1.9999999999999999e33Initial program 50.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-+.f6439.8
Applied rewrites39.8%
Taylor expanded in a around 0
Applied rewrites70.0%
if -1.9999999999999999e33 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000005e-128Initial program 99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6480.4
Applied rewrites80.4%
if 1.00000000000000005e-128 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999999e267Initial 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-+.f6470.1
Applied rewrites70.1%
if 4.9999999999999999e267 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6478.6
Applied rewrites78.6%
(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+33)
(fma y (/ (- z b) (+ t y)) a)
(if (<= t_2 5e-47)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 5e+267) (/ (* 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 <= -2e+33) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else if (t_2 <= 5e-47) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 5e+267) {
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 <= -2e+33) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); elseif (t_2 <= 5e-47) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 5e+267) 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, -2e+33], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$2, 5e-47], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+267], 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 -2 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-47}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;\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)) < -1.9999999999999999e33Initial program 50.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-+.f6439.8
Applied rewrites39.8%
Taylor expanded in a around 0
Applied rewrites70.0%
if -1.9999999999999999e33 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000011e-47Initial program 99.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6478.6
Applied rewrites78.6%
if 5.00000000000000011e-47 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999999e267Initial program 99.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6466.1
Applied rewrites66.1%
if 4.9999999999999999e267 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6478.6
Applied rewrites78.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (<= t_1 (- INFINITY))
(fma y (/ (- z b) (+ t y)) a)
(if (<= t_1 4e+303) t_1 (- (+ a z) b)))))
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 <= -((double) INFINITY)) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else if (t_1 <= 4e+303) {
tmp = t_1;
} else {
tmp = (a + z) - b;
}
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 <= Float64(-Inf)) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); elseif (t_1 <= 4e+303) tmp = t_1; else tmp = Float64(Float64(a + z) - b); 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[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$1, 4e+303], t$95$1, N[(N[(a + z), $MachinePrecision] - b), $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 -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - 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)) < -inf.0Initial program 6.3%
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-+.f647.7
Applied rewrites7.7%
Taylor expanded in a around 0
Applied rewrites69.7%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e303Initial program 99.7%
if 4e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6478.4
Applied rewrites78.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)))
(if (<= x -1.2e+257)
(* y (/ z y))
(if (<= x -5.5e+73)
(* (+ y x) (/ z t_1))
(if (<= x 1.3e+98)
(fma y (/ (- z b) (+ t y)) a)
(* (+ t y) (/ a t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double tmp;
if (x <= -1.2e+257) {
tmp = y * (z / y);
} else if (x <= -5.5e+73) {
tmp = (y + x) * (z / t_1);
} else if (x <= 1.3e+98) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = (t + y) * (a / t_1);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) tmp = 0.0 if (x <= -1.2e+257) tmp = Float64(y * Float64(z / y)); elseif (x <= -5.5e+73) tmp = Float64(Float64(y + x) * Float64(z / t_1)); elseif (x <= 1.3e+98) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(Float64(t + y) * Float64(a / t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[x, -1.2e+257], N[(y * N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e+73], N[(N[(y + x), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+98], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(t + y), $MachinePrecision] * N[(a / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+257}:\\
\;\;\;\;y \cdot \frac{z}{y}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{+73}:\\
\;\;\;\;\left(y + x\right) \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + y\right) \cdot \frac{a}{t\_1}\\
\end{array}
\end{array}
if x < -1.2e257Initial program 70.1%
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-+.f6418.2
Applied rewrites18.2%
Taylor expanded in z around inf
Applied rewrites41.4%
Taylor expanded in y around inf
Applied rewrites69.7%
if -1.2e257 < x < -5.5000000000000003e73Initial program 64.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-+.f6458.4
Applied rewrites58.4%
if -5.5000000000000003e73 < x < 1.3e98Initial program 69.5%
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-+.f6459.1
Applied rewrites59.1%
Taylor expanded in a around 0
Applied rewrites78.0%
if 1.3e98 < x Initial program 42.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6453.8
Applied rewrites53.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.6e-117) (not (<= y 1e-146))) (fma y (/ (- z b) (+ t y)) a) (/ (fma a t (* z x)) (+ t x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.6e-117) || !(y <= 1e-146)) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = fma(a, t, (z * x)) / (t + x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.6e-117) || !(y <= 1e-146)) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.6e-117], N[Not[LessEqual[y, 1e-146]], $MachinePrecision]], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{-117} \lor \neg \left(y \leq 10^{-146}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\end{array}
\end{array}
if y < -7.59999999999999945e-117 or 1.00000000000000003e-146 < y Initial program 58.2%
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-+.f6445.6
Applied rewrites45.6%
Taylor expanded in a around 0
Applied rewrites73.7%
if -7.59999999999999945e-117 < y < 1.00000000000000003e-146Initial program 80.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6463.9
Applied rewrites63.9%
Final simplification70.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3e+210)
(* y (/ z y))
(if (<= x 1.3e+98)
(fma y (/ (- z b) (+ t y)) a)
(* (+ t y) (/ a (+ (+ y x) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3e+210) {
tmp = y * (z / y);
} else if (x <= 1.3e+98) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = (t + y) * (a / ((y + x) + t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3e+210) tmp = Float64(y * Float64(z / y)); elseif (x <= 1.3e+98) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(Float64(t + y) * Float64(a / Float64(Float64(y + x) + t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3e+210], N[(y * N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+98], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(t + y), $MachinePrecision] * N[(a / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+210}:\\
\;\;\;\;y \cdot \frac{z}{y}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + y\right) \cdot \frac{a}{\left(y + x\right) + t}\\
\end{array}
\end{array}
if x < -3.00000000000000022e210Initial program 65.6%
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-+.f6414.9
Applied rewrites14.9%
Taylor expanded in z around inf
Applied rewrites38.5%
Taylor expanded in y around inf
Applied rewrites61.4%
if -3.00000000000000022e210 < x < 1.3e98Initial program 69.1%
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-+.f6455.6
Applied rewrites55.6%
Taylor expanded in a around 0
Applied rewrites73.5%
if 1.3e98 < x Initial program 42.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6453.8
Applied rewrites53.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3e+210) (* y (/ z y)) (if (<= x 5.2e+42) (fma y (/ (- z b) (+ t y)) a) (+ a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3e+210) {
tmp = y * (z / y);
} else if (x <= 5.2e+42) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = a + z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3e+210) tmp = Float64(y * Float64(z / y)); elseif (x <= 5.2e+42) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(a + z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3e+210], N[(y * N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+42], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(a + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+210}:\\
\;\;\;\;y \cdot \frac{z}{y}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if x < -3.00000000000000022e210Initial program 65.6%
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-+.f6414.9
Applied rewrites14.9%
Taylor expanded in z around inf
Applied rewrites38.5%
Taylor expanded in y around inf
Applied rewrites61.4%
if -3.00000000000000022e210 < x < 5.1999999999999998e42Initial program 69.4%
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-+.f6456.0
Applied rewrites56.0%
Taylor expanded in a around 0
Applied rewrites74.5%
if 5.1999999999999998e42 < x Initial program 44.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6446.9
Applied rewrites46.9%
Taylor expanded in b around inf
Applied rewrites7.0%
Taylor expanded in b around 0
Applied rewrites52.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -9e+74) (not (<= t 3.5e+122))) (fma (/ (- z b) t) y a) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -9e+74) || !(t <= 3.5e+122)) {
tmp = fma(((z - b) / t), y, a);
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -9e+74) || !(t <= 3.5e+122)) tmp = fma(Float64(Float64(z - b) / t), y, a); else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -9e+74], N[Not[LessEqual[t, 3.5e+122]], $MachinePrecision]], N[(N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] * y + a), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+74} \lor \neg \left(t \leq 3.5 \cdot 10^{+122}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - b}{t}, y, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -8.9999999999999999e74 or 3.50000000000000014e122 < t Initial program 49.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-+.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
Applied rewrites61.4%
if -8.9999999999999999e74 < t < 3.50000000000000014e122Initial program 71.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6465.4
Applied rewrites65.4%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -9.2e+74) (not (<= t 4e+116))) (* 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 <= -9.2e+74) || !(t <= 4e+116)) {
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 <= (-9.2d+74)) .or. (.not. (t <= 4d+116))) 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 <= -9.2e+74) || !(t <= 4e+116)) {
tmp = a * (t / (x + t));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -9.2e+74) or not (t <= 4e+116): 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 <= -9.2e+74) || !(t <= 4e+116)) 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 <= -9.2e+74) || ~((t <= 4e+116))) 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, -9.2e+74], N[Not[LessEqual[t, 4e+116]], $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 -9.2 \cdot 10^{+74} \lor \neg \left(t \leq 4 \cdot 10^{+116}\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -9.1999999999999994e74 or 4.00000000000000006e116 < t Initial program 50.5%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
Applied rewrites57.1%
if -9.1999999999999994e74 < t < 4.00000000000000006e116Initial program 71.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6465.5
Applied rewrites65.5%
Final simplification62.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.6e+180) (* y (/ z y)) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.6e+180) {
tmp = y * (z / y);
} 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 (x <= (-2.6d+180)) then
tmp = y * (z / y)
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 (x <= -2.6e+180) {
tmp = y * (z / y);
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.6e+180: tmp = y * (z / y) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.6e+180) tmp = Float64(y * Float64(z / y)); 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 (x <= -2.6e+180) tmp = y * (z / y); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.6e+180], N[(y * N[(z / y), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+180}:\\
\;\;\;\;y \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -2.60000000000000021e180Initial program 66.2%
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-+.f6416.3
Applied rewrites16.3%
Taylor expanded in z around inf
Applied rewrites35.0%
Taylor expanded in y around inf
Applied rewrites56.8%
if -2.60000000000000021e180 < x Initial program 64.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6459.3
Applied rewrites59.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.5e-18) (not (<= a 3.05e-123))) (+ a z) (- z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.5e-18) || !(a <= 3.05e-123)) {
tmp = a + z;
} else {
tmp = z - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-6.5d-18)) .or. (.not. (a <= 3.05d-123))) then
tmp = a + z
else
tmp = z - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.5e-18) || !(a <= 3.05e-123)) {
tmp = a + z;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.5e-18) or not (a <= 3.05e-123): tmp = a + z else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.5e-18) || !(a <= 3.05e-123)) tmp = Float64(a + z); else tmp = Float64(z - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.5e-18) || ~((a <= 3.05e-123))) tmp = a + z; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.5e-18], N[Not[LessEqual[a, 3.05e-123]], $MachinePrecision]], N[(a + z), $MachinePrecision], N[(z - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{-18} \lor \neg \left(a \leq 3.05 \cdot 10^{-123}\right):\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if a < -6.50000000000000008e-18 or 3.05000000000000008e-123 < a Initial program 54.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.9
Applied rewrites55.9%
Taylor expanded in b around inf
Applied rewrites9.5%
Taylor expanded in b around 0
Applied rewrites56.1%
if -6.50000000000000008e-18 < a < 3.05000000000000008e-123Initial program 79.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.8
Applied rewrites55.8%
Taylor expanded in a around 0
Applied rewrites55.1%
Final simplification55.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.2e+154) (not (<= b 9.4e+156))) (- a b) (+ a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.2e+154) || !(b <= 9.4e+156)) {
tmp = a - b;
} else {
tmp = a + z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2.2d+154)) .or. (.not. (b <= 9.4d+156))) then
tmp = a - b
else
tmp = a + z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.2e+154) || !(b <= 9.4e+156)) {
tmp = a - b;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.2e+154) or not (b <= 9.4e+156): tmp = a - b else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.2e+154) || !(b <= 9.4e+156)) tmp = Float64(a - b); else tmp = Float64(a + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.2e+154) || ~((b <= 9.4e+156))) tmp = a - b; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.2e+154], N[Not[LessEqual[b, 9.4e+156]], $MachinePrecision]], N[(a - b), $MachinePrecision], N[(a + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+154} \lor \neg \left(b \leq 9.4 \cdot 10^{+156}\right):\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if b < -2.2000000000000001e154 or 9.4e156 < b Initial program 53.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6450.4
Applied rewrites50.4%
Taylor expanded in z around 0
Applied rewrites47.7%
if -2.2000000000000001e154 < b < 9.4e156Initial program 69.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.9
Applied rewrites57.9%
Taylor expanded in b around inf
Applied rewrites7.4%
Taylor expanded in b around 0
Applied rewrites57.8%
Final simplification55.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.3e+157) (not (<= b 9.4e+156))) (- b) (+ a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e+157) || !(b <= 9.4e+156)) {
tmp = -b;
} else {
tmp = a + z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.3d+157)) .or. (.not. (b <= 9.4d+156))) then
tmp = -b
else
tmp = a + z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e+157) || !(b <= 9.4e+156)) {
tmp = -b;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.3e+157) or not (b <= 9.4e+156): tmp = -b else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.3e+157) || !(b <= 9.4e+156)) tmp = Float64(-b); else tmp = Float64(a + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.3e+157) || ~((b <= 9.4e+156))) tmp = -b; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.3e+157], N[Not[LessEqual[b, 9.4e+156]], $MachinePrecision]], (-b), N[(a + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+157} \lor \neg \left(b \leq 9.4 \cdot 10^{+156}\right):\\
\;\;\;\;-b\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if b < -1.30000000000000005e157 or 9.4e156 < b Initial program 53.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6450.4
Applied rewrites50.4%
Taylor expanded in b around inf
Applied rewrites40.9%
if -1.30000000000000005e157 < b < 9.4e156Initial program 69.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.9
Applied rewrites57.9%
Taylor expanded in b around inf
Applied rewrites7.4%
Taylor expanded in b around 0
Applied rewrites57.8%
Final simplification53.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.6e+65) (- z b) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.6e+65) {
tmp = z - 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 (x <= (-3.6d+65)) then
tmp = z - 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 (x <= -3.6e+65) {
tmp = z - b;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.6e+65: tmp = z - b else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.6e+65) tmp = Float64(z - 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 (x <= -3.6e+65) tmp = z - b; else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.6e+65], N[(z - b), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+65}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -3.59999999999999978e65Initial program 64.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6436.1
Applied rewrites36.1%
Taylor expanded in a around 0
Applied rewrites46.5%
if -3.59999999999999978e65 < x Initial program 64.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6461.0
Applied rewrites61.0%
(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 64.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.8
Applied rewrites55.8%
Taylor expanded in b around inf
Applied rewrites16.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024324
(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)))