
(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 (* (+ y t) (+ y t)))
(t_2 (/ z (+ y t)))
(t_3 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (<= t_3 -2e+278)
(fma (- z b) (* y (/ 1.0 (+ y t))) a)
(if (<= t_3 4e+303)
t_3
(-
(fma
x
(- (fma y (/ b t_1) t_2) (fma y (/ z t_1) (/ a (+ y t))))
(fma y t_2 a))
(* y (/ b (+ y t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * (y + t);
double t_2 = z / (y + t);
double t_3 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_3 <= -2e+278) {
tmp = fma((z - b), (y * (1.0 / (y + t))), a);
} else if (t_3 <= 4e+303) {
tmp = t_3;
} else {
tmp = fma(x, (fma(y, (b / t_1), t_2) - fma(y, (z / t_1), (a / (y + t)))), fma(y, t_2, a)) - (y * (b / (y + t)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) * Float64(y + t)) t_2 = Float64(z / Float64(y + t)) t_3 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_3 <= -2e+278) tmp = fma(Float64(z - b), Float64(y * Float64(1.0 / Float64(y + t))), a); elseif (t_3 <= 4e+303) tmp = t_3; else tmp = Float64(fma(x, Float64(fma(y, Float64(b / t_1), t_2) - fma(y, Float64(z / t_1), Float64(a / Float64(y + t)))), fma(y, t_2, a)) - Float64(y * Float64(b / Float64(y + t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+278], N[(N[(z - b), $MachinePrecision] * N[(y * N[(1.0 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$3, 4e+303], t$95$3, N[(N[(x * N[(N[(y * N[(b / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(y * N[(z / t$95$1), $MachinePrecision] + N[(a / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * t$95$2 + a), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot \left(y + t\right)\\
t_2 := \frac{z}{y + t}\\
t_3 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+278}:\\
\;\;\;\;\mathsf{fma}\left(z - b, y \cdot \frac{1}{y + t}, a\right)\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, \frac{b}{t\_1}, t\_2\right) - \mathsf{fma}\left(y, \frac{z}{t\_1}, \frac{a}{y + t}\right), \mathsf{fma}\left(y, t\_2, a\right)\right) - y \cdot \frac{b}{y + 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)) < -1.99999999999999993e278Initial program 12.6%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites35.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6485.5
Applied rewrites85.5%
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6490.9
Applied rewrites90.9%
if -1.99999999999999993e278 < (/.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 4.8%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites78.6%
Final simplification93.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (<= t_1 -2e+278)
(fma (- z b) (* y (/ 1.0 (+ y t))) a)
(if (<= t_1 4e+303) t_1 (fma (+ y t) (/ a (+ t (+ x y))) (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -2e+278) {
tmp = fma((z - b), (y * (1.0 / (y + t))), a);
} else if (t_1 <= 4e+303) {
tmp = t_1;
} else {
tmp = fma((y + t), (a / (t + (x + y))), (z - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_1 <= -2e+278) tmp = fma(Float64(z - b), Float64(y * Float64(1.0 / Float64(y + t))), a); elseif (t_1 <= 4e+303) tmp = t_1; else tmp = fma(Float64(y + t), Float64(a / Float64(t + Float64(x + y))), Float64(z - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+278], N[(N[(z - b), $MachinePrecision] * N[(y * N[(1.0 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$1, 4e+303], t$95$1, N[(N[(y + t), $MachinePrecision] * N[(a / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+278}:\\
\;\;\;\;\mathsf{fma}\left(z - b, y \cdot \frac{1}{y + t}, a\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + t, \frac{a}{t + \left(x + y\right)}, z - b\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999993e278Initial program 12.6%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites35.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6485.5
Applied rewrites85.5%
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6490.9
Applied rewrites90.9%
if -1.99999999999999993e278 < (/.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 4.8%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites29.3%
Taylor expanded in y around inf
lower--.f6478.1
Applied rewrites78.1%
Final simplification93.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (fma (- z b) (* y (/ 1.0 (+ y t))) a))
(t_3 (* z (+ x y)))
(t_4 (/ (- (+ t_3 (* a (+ y t))) (* y b)) t_1)))
(if (<= t_4 -2e+259)
t_2
(if (<= t_4 4e+240) (/ (fma a (+ y t) t_3) t_1) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = fma((z - b), (y * (1.0 / (y + t))), a);
double t_3 = z * (x + y);
double t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_4 <= -2e+259) {
tmp = t_2;
} else if (t_4 <= 4e+240) {
tmp = fma(a, (y + t), t_3) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = fma(Float64(z - b), Float64(y * Float64(1.0 / Float64(y + t))), a) t_3 = Float64(z * Float64(x + y)) t_4 = Float64(Float64(Float64(t_3 + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if (t_4 <= -2e+259) tmp = t_2; elseif (t_4 <= 4e+240) tmp = Float64(fma(a, Float64(y + t), t_3) / t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z - b), $MachinePrecision] * N[(y * N[(1.0 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+259], t$95$2, If[LessEqual[t$95$4, 4e+240], N[(N[(a * N[(y + t), $MachinePrecision] + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \mathsf{fma}\left(z - b, y \cdot \frac{1}{y + t}, a\right)\\
t_3 := z \cdot \left(x + y\right)\\
t_4 := \frac{\left(t\_3 + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+259}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+240}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, y + t, t\_3\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e259 or 4.00000000000000006e240 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 18.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites37.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6476.1
Applied rewrites76.1%
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6482.4
Applied rewrites82.4%
if -2e259 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000006e240Initial program 99.6%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6478.4
Applied rewrites78.4%
Final simplification80.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.3e-42)
(fma (- z b) (* y (/ 1.0 (+ y t))) a)
(if (<= y 3.1e-159)
(/ (fma a t (* x z)) (+ x t))
(if (<= y 0.016)
(fma (+ y t) (/ a (+ t (+ x y))) (- z b))
(fma y (/ (- z b) (+ y t)) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.3e-42) {
tmp = fma((z - b), (y * (1.0 / (y + t))), a);
} else if (y <= 3.1e-159) {
tmp = fma(a, t, (x * z)) / (x + t);
} else if (y <= 0.016) {
tmp = fma((y + t), (a / (t + (x + y))), (z - b));
} else {
tmp = fma(y, ((z - b) / (y + t)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.3e-42) tmp = fma(Float64(z - b), Float64(y * Float64(1.0 / Float64(y + t))), a); elseif (y <= 3.1e-159) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(x + t)); elseif (y <= 0.016) tmp = fma(Float64(y + t), Float64(a / Float64(t + Float64(x + y))), Float64(z - b)); else tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.3e-42], N[(N[(z - b), $MachinePrecision] * N[(y * N[(1.0 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[y, 3.1e-159], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.016], N[(N[(y + t), $MachinePrecision] * N[(a / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(z - b, y \cdot \frac{1}{y + t}, a\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-159}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{x + t}\\
\mathbf{elif}\;y \leq 0.016:\\
\;\;\;\;\mathsf{fma}\left(y + t, \frac{a}{t + \left(x + y\right)}, z - b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\end{array}
\end{array}
if y < -3.3000000000000002e-42Initial program 55.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites64.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6484.2
Applied rewrites84.2%
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6485.4
Applied rewrites85.4%
if -3.3000000000000002e-42 < y < 3.1e-159Initial program 90.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6470.2
Applied rewrites70.2%
if 3.1e-159 < y < 0.016Initial program 77.9%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites88.7%
Taylor expanded in y around inf
lower--.f6474.3
Applied rewrites74.3%
if 0.016 < y Initial program 48.6%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites60.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6482.6
Applied rewrites82.6%
Final simplification78.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.3e-42)
(fma (- z b) (* y (/ 1.0 (+ y t))) a)
(if (<= y 2.5e-73)
(/ (fma a t (* x z)) (+ x t))
(fma y (/ (- z b) (+ y t)) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.3e-42) {
tmp = fma((z - b), (y * (1.0 / (y + t))), a);
} else if (y <= 2.5e-73) {
tmp = fma(a, t, (x * z)) / (x + t);
} else {
tmp = fma(y, ((z - b) / (y + t)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.3e-42) tmp = fma(Float64(z - b), Float64(y * Float64(1.0 / Float64(y + t))), a); elseif (y <= 2.5e-73) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(x + t)); else tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.3e-42], N[(N[(z - b), $MachinePrecision] * N[(y * N[(1.0 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[y, 2.5e-73], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(z - b, y \cdot \frac{1}{y + t}, a\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-73}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{x + t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\end{array}
\end{array}
if y < -3.3000000000000002e-42Initial program 55.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites64.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6484.2
Applied rewrites84.2%
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6485.4
Applied rewrites85.4%
if -3.3000000000000002e-42 < y < 2.4999999999999999e-73Initial program 89.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6467.3
Applied rewrites67.3%
if 2.4999999999999999e-73 < y Initial program 52.4%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6480.0
Applied rewrites80.0%
Final simplification76.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma y (/ (- z b) (+ y t)) a)))
(if (<= y -2.7e-39)
t_1
(if (<= y 2.5e-73) (/ (fma a t (* x z)) (+ x t)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, ((z - b) / (y + t)), a);
double tmp;
if (y <= -2.7e-39) {
tmp = t_1;
} else if (y <= 2.5e-73) {
tmp = fma(a, t, (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(y, Float64(Float64(z - b) / Float64(y + t)), a) tmp = 0.0 if (y <= -2.7e-39) tmp = t_1; elseif (y <= 2.5e-73) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(x + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[y, -2.7e-39], t$95$1, If[LessEqual[y, 2.5e-73], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-73}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.7000000000000001e-39 or 2.4999999999999999e-73 < y Initial program 54.3%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6482.5
Applied rewrites82.5%
if -2.7000000000000001e-39 < y < 2.4999999999999999e-73Initial program 88.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6466.7
Applied rewrites66.7%
Final simplification76.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (* t (/ a x)))))
(if (<= x -4.2e+60)
t_1
(if (<= x 1.26e+175) (fma y (/ (- z b) (+ y t)) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (t * (a / x));
double tmp;
if (x <= -4.2e+60) {
tmp = t_1;
} else if (x <= 1.26e+175) {
tmp = fma(y, ((z - b) / (y + t)), a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(t * Float64(a / x))) tmp = 0.0 if (x <= -4.2e+60) tmp = t_1; elseif (x <= 1.26e+175) tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(t * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e+60], t$95$1, If[LessEqual[x, 1.26e+175], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + t \cdot \frac{a}{x}\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{+175}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.2000000000000002e60 or 1.26e175 < x Initial program 59.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6445.6
Applied rewrites45.6%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6462.8
Applied rewrites62.8%
Taylor expanded in a around inf
lower-/.f6463.3
Applied rewrites63.3%
if -4.2000000000000002e60 < x < 1.26e175Initial program 71.1%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites75.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6478.9
Applied rewrites78.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.95e+30) (fma y (- (/ b (+ y t))) a) (if (<= t 3.6e+173) (- a (- b z)) (fma y (/ (- z b) t) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.95e+30) {
tmp = fma(y, -(b / (y + t)), a);
} else if (t <= 3.6e+173) {
tmp = a - (b - z);
} else {
tmp = fma(y, ((z - b) / t), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.95e+30) tmp = fma(y, Float64(-Float64(b / Float64(y + t))), a); elseif (t <= 3.6e+173) tmp = Float64(a - Float64(b - z)); else tmp = fma(y, Float64(Float64(z - b) / t), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.95e+30], N[(y * (-N[(b / N[(y + t), $MachinePrecision]), $MachinePrecision]) + a), $MachinePrecision], If[LessEqual[t, 3.6e+173], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(y, -\frac{b}{y + t}, a\right)\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+173}:\\
\;\;\;\;a - \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\
\end{array}
\end{array}
if t < -1.95000000000000005e30Initial program 66.1%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites70.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6473.6
Applied rewrites73.6%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6463.1
Applied rewrites63.1%
if -1.95000000000000005e30 < t < 3.6000000000000002e173Initial program 71.7%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6462.6
Applied rewrites62.6%
if 3.6000000000000002e173 < t Initial program 49.4%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites68.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6484.7
Applied rewrites84.7%
Taylor expanded in y around 0
div-subN/A
associate-/l*N/A
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.8e+30) (fma b (- (/ y (+ y t))) a) (if (<= t 3.6e+173) (- a (- b z)) (fma y (/ (- z b) t) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.8e+30) {
tmp = fma(b, -(y / (y + t)), a);
} else if (t <= 3.6e+173) {
tmp = a - (b - z);
} else {
tmp = fma(y, ((z - b) / t), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.8e+30) tmp = fma(b, Float64(-Float64(y / Float64(y + t))), a); elseif (t <= 3.6e+173) tmp = Float64(a - Float64(b - z)); else tmp = fma(y, Float64(Float64(z - b) / t), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.8e+30], N[(b * (-N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]) + a), $MachinePrecision], If[LessEqual[t, 3.6e+173], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(b, -\frac{y}{y + t}, a\right)\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+173}:\\
\;\;\;\;a - \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\
\end{array}
\end{array}
if t < -2.79999999999999983e30Initial program 66.1%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites70.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6473.6
Applied rewrites73.6%
Taylor expanded in z around 0
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
if -2.79999999999999983e30 < t < 3.6000000000000002e173Initial program 71.7%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6462.6
Applied rewrites62.6%
if 3.6000000000000002e173 < t Initial program 49.4%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites68.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6484.7
Applied rewrites84.7%
Taylor expanded in y around 0
div-subN/A
associate-/l*N/A
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma y (/ (- z b) t) a))) (if (<= t -2.5e+94) t_1 (if (<= t 3.6e+173) (- a (- b z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, ((z - b) / t), a);
double tmp;
if (t <= -2.5e+94) {
tmp = t_1;
} else if (t <= 3.6e+173) {
tmp = a - (b - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(y, Float64(Float64(z - b) / t), a) tmp = 0.0 if (t <= -2.5e+94) tmp = t_1; elseif (t <= 3.6e+173) tmp = Float64(a - Float64(b - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t, -2.5e+94], t$95$1, If[LessEqual[t, 3.6e+173], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+173}:\\
\;\;\;\;a - \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.50000000000000005e94 or 3.6000000000000002e173 < t Initial program 60.0%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites70.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6475.6
Applied rewrites75.6%
Taylor expanded in y around 0
div-subN/A
associate-/l*N/A
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6468.3
Applied rewrites68.3%
if -2.50000000000000005e94 < t < 3.6000000000000002e173Initial program 70.8%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6462.6
Applied rewrites62.6%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ z (* t (/ a x))))) (if (<= x -7.8e+88) t_1 (if (<= x 4.6e+136) (- a (- b z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (t * (a / x));
double tmp;
if (x <= -7.8e+88) {
tmp = t_1;
} else if (x <= 4.6e+136) {
tmp = a - (b - z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z + (t * (a / x))
if (x <= (-7.8d+88)) then
tmp = t_1
else if (x <= 4.6d+136) then
tmp = a - (b - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (t * (a / x));
double tmp;
if (x <= -7.8e+88) {
tmp = t_1;
} else if (x <= 4.6e+136) {
tmp = a - (b - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (t * (a / x)) tmp = 0 if x <= -7.8e+88: tmp = t_1 elif x <= 4.6e+136: tmp = a - (b - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(t * Float64(a / x))) tmp = 0.0 if (x <= -7.8e+88) tmp = t_1; elseif (x <= 4.6e+136) tmp = Float64(a - Float64(b - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (t * (a / x)); tmp = 0.0; if (x <= -7.8e+88) tmp = t_1; elseif (x <= 4.6e+136) tmp = a - (b - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(t * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+88], t$95$1, If[LessEqual[x, 4.6e+136], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + t \cdot \frac{a}{x}\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+136}:\\
\;\;\;\;a - \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.8000000000000002e88 or 4.6e136 < x Initial program 62.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6446.5
Applied rewrites46.5%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
Taylor expanded in a around inf
lower-/.f6462.2
Applied rewrites62.2%
if -7.8000000000000002e88 < x < 4.6e136Initial program 69.9%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6461.2
Applied rewrites61.2%
Final simplification61.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- a (- b z))))
(if (<= y -7.8e-42)
t_1
(if (<= y 2.35e-269) (* a (/ t (+ x t))) (if (<= y 1.45e-73) z t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a - (b - z);
double tmp;
if (y <= -7.8e-42) {
tmp = t_1;
} else if (y <= 2.35e-269) {
tmp = a * (t / (x + t));
} else if (y <= 1.45e-73) {
tmp = z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a - (b - z)
if (y <= (-7.8d-42)) then
tmp = t_1
else if (y <= 2.35d-269) then
tmp = a * (t / (x + t))
else if (y <= 1.45d-73) then
tmp = z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a - (b - z);
double tmp;
if (y <= -7.8e-42) {
tmp = t_1;
} else if (y <= 2.35e-269) {
tmp = a * (t / (x + t));
} else if (y <= 1.45e-73) {
tmp = z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a - (b - z) tmp = 0 if y <= -7.8e-42: tmp = t_1 elif y <= 2.35e-269: tmp = a * (t / (x + t)) elif y <= 1.45e-73: tmp = z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a - Float64(b - z)) tmp = 0.0 if (y <= -7.8e-42) tmp = t_1; elseif (y <= 2.35e-269) tmp = Float64(a * Float64(t / Float64(x + t))); elseif (y <= 1.45e-73) tmp = z; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a - (b - z); tmp = 0.0; if (y <= -7.8e-42) tmp = t_1; elseif (y <= 2.35e-269) tmp = a * (t / (x + t)); elseif (y <= 1.45e-73) tmp = z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e-42], t$95$1, If[LessEqual[y, 2.35e-269], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e-73], z, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a - \left(b - z\right)\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-269}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-73}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.8000000000000003e-42 or 1.45e-73 < y Initial program 54.0%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6467.4
Applied rewrites67.4%
if -7.8000000000000003e-42 < y < 2.3499999999999999e-269Initial program 92.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6472.2
Applied rewrites72.2%
Taylor expanded in a around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6445.6
Applied rewrites45.6%
lift-+.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6448.6
lift-+.f64N/A
+-commutativeN/A
lift-+.f6448.6
Applied rewrites48.6%
if 2.3499999999999999e-269 < y < 1.45e-73Initial program 84.6%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Applied rewrites92.2%
Taylor expanded in x around inf
Applied rewrites55.8%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.95e+114) z (if (<= x 5.4e+234) (- a (- b z)) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.95e+114) {
tmp = z;
} else if (x <= 5.4e+234) {
tmp = a - (b - z);
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.95d+114)) then
tmp = z
else if (x <= 5.4d+234) then
tmp = a - (b - z)
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.95e+114) {
tmp = z;
} else if (x <= 5.4e+234) {
tmp = a - (b - z);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.95e+114: tmp = z elif x <= 5.4e+234: tmp = a - (b - z) else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.95e+114) tmp = z; elseif (x <= 5.4e+234) tmp = Float64(a - Float64(b - z)); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.95e+114) tmp = z; elseif (x <= 5.4e+234) tmp = a - (b - z); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.95e+114], z, If[LessEqual[x, 5.4e+234], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+114}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+234}:\\
\;\;\;\;a - \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.95e114 or 5.4000000000000003e234 < x Initial program 60.4%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Applied rewrites81.5%
Taylor expanded in x around inf
Applied rewrites56.0%
if -1.95e114 < x < 5.4000000000000003e234Initial program 69.6%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6460.0
Applied rewrites60.0%
Final simplification59.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.65e-66) (+ z a) (if (<= z 3.1e-82) (- a b) (+ z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.65e-66) {
tmp = z + a;
} else if (z <= 3.1e-82) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.65d-66)) then
tmp = z + a
else if (z <= 3.1d-82) then
tmp = a - b
else
tmp = z + a
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.65e-66) {
tmp = z + a;
} else if (z <= 3.1e-82) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.65e-66: tmp = z + a elif z <= 3.1e-82: tmp = a - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.65e-66) tmp = Float64(z + a); elseif (z <= 3.1e-82) tmp = Float64(a - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.65e-66) tmp = z + a; elseif (z <= 3.1e-82) tmp = a - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.65e-66], N[(z + a), $MachinePrecision], If[LessEqual[z, 3.1e-82], N[(a - b), $MachinePrecision], N[(z + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.65 \cdot 10^{-66}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-82}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if z < -3.6499999999999999e-66 or 3.1e-82 < z Initial program 64.4%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6456.9
Applied rewrites56.9%
Taylor expanded in b around 0
lower-+.f6458.8
Applied rewrites58.8%
if -3.6499999999999999e-66 < z < 3.1e-82Initial program 73.2%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6448.7
Applied rewrites48.7%
Taylor expanded in z around 0
lower--.f6446.5
Applied rewrites46.5%
Final simplification54.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6.9e+106) (+ z a) (- a (- b z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.9e+106) {
tmp = z + a;
} else {
tmp = a - (b - z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.9d+106)) then
tmp = z + a
else
tmp = a - (b - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.9e+106) {
tmp = z + a;
} else {
tmp = a - (b - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.9e+106: tmp = z + a else: tmp = a - (b - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.9e+106) tmp = Float64(z + a); else tmp = Float64(a - Float64(b - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.9e+106) tmp = z + a; else tmp = a - (b - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.9e+106], N[(z + a), $MachinePrecision], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.9 \cdot 10^{+106}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - \left(b - z\right)\\
\end{array}
\end{array}
if x < -6.8999999999999998e106Initial program 60.9%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6437.2
Applied rewrites37.2%
Taylor expanded in b around 0
lower-+.f6448.5
Applied rewrites48.5%
if -6.8999999999999998e106 < x Initial program 68.9%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6456.8
Applied rewrites56.8%
Final simplification55.5%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 67.7%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6453.8
Applied rewrites53.8%
Taylor expanded in b around 0
lower-+.f6449.0
Applied rewrites49.0%
Final simplification49.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 67.7%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower--.f6453.8
Applied rewrites53.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6412.4
Applied rewrites12.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 2024216
(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)))