
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (/ 1.0 (/ (/ (fma t (fma y (/ b t) a) t) y) z))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -5e-323)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 2e+275) t_2 (if (<= t_2 INFINITY) t_3 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_3 = 1.0 / ((fma(t, fma(y, (b / t), a), t) / y) / z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -5e-323) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 2e+275) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(1.0 / Float64(Float64(fma(t, fma(y, Float64(b / t), a), t) / y) / z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -5e-323) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 2e+275) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[(N[(t * N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -5e-323], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 2e+275], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \frac{1}{\frac{\frac{\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t}, a\right), t\right)}{y}}{z}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 1.99999999999999992e275 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 24.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6419.9
Applied rewrites19.9%
lift-/.f64N/A
clear-numN/A
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-/.f6424.4
Applied rewrites51.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
Applied rewrites80.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.99999999999999992e275Initial program 99.1%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t)))
(t_2 (/ (fma t (/ x y) z) b))
(t_3 (/ (+ x (/ (* y z) t)) t_1)))
(if (<= t_3 (- INFINITY))
(* y (/ z (fma t (fma b (/ y t) a) t)))
(if (<= t_3 -5e-323)
t_3
(if (<= t_3 0.0)
t_2
(if (<= t_3 5e+292)
t_3
(if (<= t_3 INFINITY) (/ (fma (/ z t) y x) t_1) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = fma(t, (x / y), z) / b;
double t_3 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = y * (z / fma(t, fma(b, (y / t), a), t));
} else if (t_3 <= -5e-323) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_2;
} else if (t_3 <= 5e+292) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma((z / t), y, x) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(fma(t, Float64(x / y), z) / b) t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(t, fma(b, Float64(y / t), a), t))); elseif (t_3 <= -5e-323) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_2; elseif (t_3 <= 5e+292) tmp = t_3; elseif (t_3 <= Inf) tmp = Float64(fma(Float64(z / t), y, x) / t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(y * N[(z / N[(t * N[(b * N[(y / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-323], t$95$3, If[LessEqual[t$95$3, 0.0], t$95$2, If[LessEqual[t$95$3, 5e+292], t$95$3, If[LessEqual[t$95$3, Infinity], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(t, \mathsf{fma}\left(b, \frac{y}{t}, a\right), t\right)}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 19.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6446.6
Applied rewrites46.6%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-fma.f6445.1
Applied rewrites45.1%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6465.1
Applied rewrites65.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e292Initial program 99.1%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
if 4.9999999999999996e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 24.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6462.3
Applied rewrites62.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t)))
(t_2 (/ (fma t (/ x y) z) b))
(t_3 (+ x (/ (* y z) t)))
(t_4 (/ t_3 (fma b (/ y t) (+ a 1.0))))
(t_5 (/ t_3 t_1)))
(if (<= t_5 (- INFINITY))
(* y (/ z (fma t (fma b (/ y t) a) t)))
(if (<= t_5 -5e-323)
t_4
(if (<= t_5 0.0)
t_2
(if (<= t_5 5e+292)
t_4
(if (<= t_5 INFINITY) (/ (fma (/ z t) y x) t_1) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = fma(t, (x / y), z) / b;
double t_3 = x + ((y * z) / t);
double t_4 = t_3 / fma(b, (y / t), (a + 1.0));
double t_5 = t_3 / t_1;
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = y * (z / fma(t, fma(b, (y / t), a), t));
} else if (t_5 <= -5e-323) {
tmp = t_4;
} else if (t_5 <= 0.0) {
tmp = t_2;
} else if (t_5 <= 5e+292) {
tmp = t_4;
} else if (t_5 <= ((double) INFINITY)) {
tmp = fma((z / t), y, x) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(fma(t, Float64(x / y), z) / b) t_3 = Float64(x + Float64(Float64(y * z) / t)) t_4 = Float64(t_3 / fma(b, Float64(y / t), Float64(a + 1.0))) t_5 = Float64(t_3 / t_1) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(t, fma(b, Float64(y / t), a), t))); elseif (t_5 <= -5e-323) tmp = t_4; elseif (t_5 <= 0.0) tmp = t_2; elseif (t_5 <= 5e+292) tmp = t_4; elseif (t_5 <= Inf) tmp = Float64(fma(Float64(z / t), y, x) / t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[(b * N[(y / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], N[(y * N[(z / N[(t * N[(b * N[(y / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -5e-323], t$95$4, If[LessEqual[t$95$5, 0.0], t$95$2, If[LessEqual[t$95$5, 5e+292], t$95$4, If[LessEqual[t$95$5, Infinity], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_3 := x + \frac{y \cdot z}{t}\\
t_4 := \frac{t\_3}{\mathsf{fma}\left(b, \frac{y}{t}, a + 1\right)}\\
t_5 := \frac{t\_3}{t\_1}\\
\mathbf{if}\;t\_5 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(t, \mathsf{fma}\left(b, \frac{y}{t}, a\right), t\right)}\\
\mathbf{elif}\;t\_5 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_5 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 19.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6446.6
Applied rewrites46.6%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-fma.f6445.1
Applied rewrites45.1%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6465.1
Applied rewrites65.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e292Initial program 99.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6496.2
Applied rewrites96.2%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
if 4.9999999999999996e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 24.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6462.3
Applied rewrites62.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b))
(t_2 (+ x (/ (* y z) t)))
(t_3 (/ t_2 (fma b (/ y t) (+ a 1.0))))
(t_4 (/ t_2 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_4 (- INFINITY))
(* y (/ z (fma t (fma b (/ y t) a) t)))
(if (<= t_4 -5e-323)
t_3
(if (<= t_4 0.0)
t_1
(if (<= t_4 5e+292)
t_3
(if (<= t_4 INFINITY)
(/ (fma y (/ z t) x) (fma y (/ b t) (+ a 1.0)))
t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / fma(b, (y / t), (a + 1.0));
double t_4 = t_2 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = y * (z / fma(t, fma(b, (y / t), a), t));
} else if (t_4 <= -5e-323) {
tmp = t_3;
} else if (t_4 <= 0.0) {
tmp = t_1;
} else if (t_4 <= 5e+292) {
tmp = t_3;
} else if (t_4 <= ((double) INFINITY)) {
tmp = fma(y, (z / t), x) / fma(y, (b / t), (a + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(t_2 / fma(b, Float64(y / t), Float64(a + 1.0))) t_4 = Float64(t_2 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(t, fma(b, Float64(y / t), a), t))); elseif (t_4 <= -5e-323) tmp = t_3; elseif (t_4 <= 0.0) tmp = t_1; elseif (t_4 <= 5e+292) tmp = t_3; elseif (t_4 <= Inf) tmp = Float64(fma(y, Float64(z / t), x) / fma(y, Float64(b / t), Float64(a + 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(b * N[(y / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(y * N[(z / N[(t * N[(b * N[(y / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, -5e-323], t$95$3, If[LessEqual[t$95$4, 0.0], t$95$1, If[LessEqual[t$95$4, 5e+292], t$95$3, If[LessEqual[t$95$4, Infinity], N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := \frac{t\_2}{\mathsf{fma}\left(b, \frac{y}{t}, a + 1\right)}\\
t_4 := \frac{t\_2}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(t, \mathsf{fma}\left(b, \frac{y}{t}, a\right), t\right)}\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 19.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6446.6
Applied rewrites46.6%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-fma.f6445.1
Applied rewrites45.1%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6465.1
Applied rewrites65.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e292Initial program 99.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6496.2
Applied rewrites96.2%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
if 4.9999999999999996e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 24.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6462.3
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6462.0
Applied rewrites62.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t))
(t_2 (/ (fma t (/ x y) z) b))
(t_3 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) t_1)))
(t_4 (fma z (/ y t) x))
(t_5 (/ (fma (/ z t) y x) (+ a t_1))))
(if (<= t_3 -1e-100)
(/ t_4 (+ a 1.0))
(if (<= t_3 -5e-323)
t_5
(if (<= t_3 0.0)
t_2
(if (<= t_3 1e+52)
t_5
(if (<= t_3 INFINITY) (/ t_4 (fma y (/ b t) 1.0)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = fma(t, (x / y), z) / b;
double t_3 = (x + ((y * z) / t)) / ((a + 1.0) + t_1);
double t_4 = fma(z, (y / t), x);
double t_5 = fma((z / t), y, x) / (a + t_1);
double tmp;
if (t_3 <= -1e-100) {
tmp = t_4 / (a + 1.0);
} else if (t_3 <= -5e-323) {
tmp = t_5;
} else if (t_3 <= 0.0) {
tmp = t_2;
} else if (t_3 <= 1e+52) {
tmp = t_5;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4 / fma(y, (b / t), 1.0);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(fma(t, Float64(x / y), z) / b) t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + t_1)) t_4 = fma(z, Float64(y / t), x) t_5 = Float64(fma(Float64(z / t), y, x) / Float64(a + t_1)) tmp = 0.0 if (t_3 <= -1e-100) tmp = Float64(t_4 / Float64(a + 1.0)); elseif (t_3 <= -5e-323) tmp = t_5; elseif (t_3 <= 0.0) tmp = t_2; elseif (t_3 <= 1e+52) tmp = t_5; elseif (t_3 <= Inf) tmp = Float64(t_4 / fma(y, Float64(b / t), 1.0)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-100], N[(t$95$4 / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-323], t$95$5, If[LessEqual[t$95$3, 0.0], t$95$2, If[LessEqual[t$95$3, 1e+52], t$95$5, If[LessEqual[t$95$3, Infinity], N[(t$95$4 / N[(y * N[(b / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + t\_1}\\
t_4 := \mathsf{fma}\left(z, \frac{y}{t}, x\right)\\
t_5 := \frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{a + t\_1}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-100}:\\
\;\;\;\;\frac{t\_4}{a + 1}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 10^{+52}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{t\_4}{\mathsf{fma}\left(y, \frac{b}{t}, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1e-100Initial program 83.8%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6470.9
Applied rewrites70.9%
if -1e-100 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.9999999999999999e51Initial program 98.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-fma.f6491.2
Applied rewrites91.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
if 9.9999999999999999e51 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.1%
Taylor expanded in a around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6470.7
Applied rewrites70.7%
Final simplification78.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 (- INFINITY))
(/ 1.0 (/ (/ (fma t (fma y (/ b t) a) t) y) z))
(if (<= t_2 -5e-323)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 INFINITY)
(/ 1.0 (/ (+ a (fma b (/ y t) 1.0)) (fma z (/ y t) x)))
t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 1.0 / ((fma(t, fma(y, (b / t), a), t) / y) / z);
} else if (t_2 <= -5e-323) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = 1.0 / ((a + fma(b, (y / t), 1.0)) / fma(z, (y / t), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(1.0 / Float64(Float64(fma(t, fma(y, Float64(b / t), a), t) / y) / z)); elseif (t_2 <= -5e-323) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= Inf) tmp = Float64(1.0 / Float64(Float64(a + fma(b, Float64(y / t), 1.0)) / fma(z, Float64(y / t), x))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(1.0 / N[(N[(N[(t * N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-323], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, Infinity], N[(1.0 / N[(N[(a + N[(b * N[(y / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t}, a\right), t\right)}{y}}{z}}\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{1}{\frac{a + \mathsf{fma}\left(b, \frac{y}{t}, 1\right)}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 19.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6417.9
Applied rewrites17.9%
lift-/.f64N/A
clear-numN/A
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-/.f6419.3
Applied rewrites45.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6444.6
Applied rewrites44.6%
Applied rewrites85.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323Initial program 99.6%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 86.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
lift-/.f64N/A
clear-numN/A
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-/.f6486.5
Applied rewrites91.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 -5e-323)
(/ (fma y (/ z t) x) (fma y (/ b t) (+ a 1.0)))
(if (<= t_2 0.0)
t_1
(if (<= t_2 INFINITY)
(/ (fma (/ z t) y x) (+ a (fma b (/ y t) 1.0)))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -5e-323) {
tmp = fma(y, (z / t), x) / fma(y, (b / t), (a + 1.0));
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma((z / t), y, x) / (a + fma(b, (y / t), 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= -5e-323) tmp = Float64(fma(y, Float64(z / t), x) / fma(y, Float64(b / t), Float64(a + 1.0))); elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= Inf) tmp = Float64(fma(Float64(z / t), y, x) / Float64(a + fma(b, Float64(y / t), 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-323], N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, Infinity], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / N[(a + N[(b * N[(y / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{a + \mathsf{fma}\left(b, \frac{y}{t}, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323Initial program 88.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6482.7
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.7
Applied rewrites81.7%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 86.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-fma.f6482.5
Applied rewrites82.5%
Final simplification84.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (/ (fma y (/ z t) x) (fma y (/ b t) (+ a 1.0)))))
(if (<= t_2 -5e-323)
t_3
(if (<= t_2 0.0) t_1 (if (<= t_2 INFINITY) t_3 t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_3 = fma(y, (z / t), x) / fma(y, (b / t), (a + 1.0));
double tmp;
if (t_2 <= -5e-323) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(fma(y, Float64(z / t), x) / fma(y, Float64(b / t), Float64(a + 1.0))) tmp = 0.0 if (t_2 <= -5e-323) tmp = t_3; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= Inf) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-323], t$95$3, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-323}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.94066e-323 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 87.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6483.7
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.2
Applied rewrites81.2%
if -4.94066e-323 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 24.7%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites36.4%
Taylor expanded in b around inf
Applied rewrites90.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -2.3e+108)
t_1
(if (<= y 9.6e-37) (/ (fma z (/ y t) x) (+ a 1.0)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -2.3e+108) {
tmp = t_1;
} else if (y <= 9.6e-37) {
tmp = fma(z, (y / t), x) / (a + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -2.3e+108) tmp = t_1; elseif (y <= 9.6e-37) tmp = Float64(fma(z, Float64(y / t), x) / Float64(a + 1.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -2.3e+108], t$95$1, If[LessEqual[y, 9.6e-37], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2999999999999999e108 or 9.59999999999999963e-37 < y Initial program 47.6%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites49.1%
Taylor expanded in b around inf
Applied rewrites71.0%
if -2.2999999999999999e108 < y < 9.59999999999999963e-37Initial program 90.3%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6475.2
Applied rewrites75.2%
Final simplification73.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -3.2e+94)
t_1
(if (<= y 8.5e-37) (/ x (+ a (fma b (/ y t) 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -3.2e+94) {
tmp = t_1;
} else if (y <= 8.5e-37) {
tmp = x / (a + fma(b, (y / t), 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -3.2e+94) tmp = t_1; elseif (y <= 8.5e-37) tmp = Float64(x / Float64(a + fma(b, Float64(y / t), 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -3.2e+94], t$95$1, If[LessEqual[y, 8.5e-37], N[(x / N[(a + N[(b * N[(y / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{a + \mathsf{fma}\left(b, \frac{y}{t}, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.20000000000000014e94 or 8.5000000000000007e-37 < y Initial program 48.5%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.1%
Taylor expanded in b around inf
Applied rewrites69.8%
if -3.20000000000000014e94 < y < 8.5000000000000007e-37Initial program 90.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6459.7
Applied rewrites59.7%
Applied rewrites62.4%
Final simplification65.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -3.2e+94)
t_1
(if (<= y 8.5e-37) (/ x (+ 1.0 (fma y (/ b t) a))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -3.2e+94) {
tmp = t_1;
} else if (y <= 8.5e-37) {
tmp = x / (1.0 + fma(y, (b / t), a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -3.2e+94) tmp = t_1; elseif (y <= 8.5e-37) tmp = Float64(x / Float64(1.0 + fma(y, Float64(b / t), a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -3.2e+94], t$95$1, If[LessEqual[y, 8.5e-37], N[(x / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.20000000000000014e94 or 8.5000000000000007e-37 < y Initial program 48.5%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.1%
Taylor expanded in b around inf
Applied rewrites69.8%
if -3.20000000000000014e94 < y < 8.5000000000000007e-37Initial program 90.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6459.7
Applied rewrites59.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (fma t (/ x y) z) b))) (if (<= y -1.2e-39) t_1 (if (<= y 7.5e-38) (/ x (+ a 1.0)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -1.2e-39) {
tmp = t_1;
} else if (y <= 7.5e-38) {
tmp = x / (a + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -1.2e-39) tmp = t_1; elseif (y <= 7.5e-38) tmp = Float64(x / Float64(a + 1.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -1.2e-39], t$95$1, If[LessEqual[y, 7.5e-38], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.20000000000000008e-39 or 7.5e-38 < y Initial program 54.5%
Taylor expanded in x around inf
distribute-lft-inN/A
associate-*r/N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites53.6%
Taylor expanded in b around inf
Applied rewrites63.4%
if -1.20000000000000008e-39 < y < 7.5e-38Initial program 92.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6457.5
Applied rewrites57.5%
Final simplification60.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7.8e-45) (/ z b) (if (<= y 6.8e-146) (/ x a) (if (<= y 2.45e-42) (/ x 1.0) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.8e-45) {
tmp = z / b;
} else if (y <= 6.8e-146) {
tmp = x / a;
} else if (y <= 2.45e-42) {
tmp = x / 1.0;
} 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 (y <= (-7.8d-45)) then
tmp = z / b
else if (y <= 6.8d-146) then
tmp = x / a
else if (y <= 2.45d-42) then
tmp = x / 1.0d0
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 (y <= -7.8e-45) {
tmp = z / b;
} else if (y <= 6.8e-146) {
tmp = x / a;
} else if (y <= 2.45e-42) {
tmp = x / 1.0;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.8e-45: tmp = z / b elif y <= 6.8e-146: tmp = x / a elif y <= 2.45e-42: tmp = x / 1.0 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.8e-45) tmp = Float64(z / b); elseif (y <= 6.8e-146) tmp = Float64(x / a); elseif (y <= 2.45e-42) tmp = Float64(x / 1.0); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.8e-45) tmp = z / b; elseif (y <= 6.8e-146) tmp = x / a; elseif (y <= 2.45e-42) tmp = x / 1.0; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.8e-45], N[(z / b), $MachinePrecision], If[LessEqual[y, 6.8e-146], N[(x / a), $MachinePrecision], If[LessEqual[y, 2.45e-42], N[(x / 1.0), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-45}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-146}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-42}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -7.7999999999999999e-45 or 2.45e-42 < y Initial program 54.8%
Taylor expanded in y around inf
lower-/.f6451.1
Applied rewrites51.1%
if -7.7999999999999999e-45 < y < 6.8000000000000001e-146Initial program 95.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-+.f6459.8
Applied rewrites59.8%
Taylor expanded in a around inf
Applied rewrites41.3%
if 6.8000000000000001e-146 < y < 2.45e-42Initial program 85.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6483.1
Applied rewrites83.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-+.f6450.4
Applied rewrites50.4%
Taylor expanded in a around 0
Applied rewrites36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7.8e-45) (/ z b) (if (<= y 2.3e-140) (/ x a) (if (<= y 1.66e-43) (- x (* x a)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.8e-45) {
tmp = z / b;
} else if (y <= 2.3e-140) {
tmp = x / a;
} else if (y <= 1.66e-43) {
tmp = x - (x * a);
} 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 (y <= (-7.8d-45)) then
tmp = z / b
else if (y <= 2.3d-140) then
tmp = x / a
else if (y <= 1.66d-43) then
tmp = x - (x * a)
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 (y <= -7.8e-45) {
tmp = z / b;
} else if (y <= 2.3e-140) {
tmp = x / a;
} else if (y <= 1.66e-43) {
tmp = x - (x * a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.8e-45: tmp = z / b elif y <= 2.3e-140: tmp = x / a elif y <= 1.66e-43: tmp = x - (x * a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.8e-45) tmp = Float64(z / b); elseif (y <= 2.3e-140) tmp = Float64(x / a); elseif (y <= 1.66e-43) tmp = Float64(x - Float64(x * a)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.8e-45) tmp = z / b; elseif (y <= 2.3e-140) tmp = x / a; elseif (y <= 1.66e-43) tmp = x - (x * a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.8e-45], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.3e-140], N[(x / a), $MachinePrecision], If[LessEqual[y, 1.66e-43], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-45}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-140}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{-43}:\\
\;\;\;\;x - x \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -7.7999999999999999e-45 or 1.66e-43 < y Initial program 55.2%
Taylor expanded in y around inf
lower-/.f6450.7
Applied rewrites50.7%
if -7.7999999999999999e-45 < y < 2.3000000000000001e-140Initial program 94.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-/.f64N/A
lower-+.f6459.2
Applied rewrites59.2%
Taylor expanded in a around inf
Applied rewrites40.8%
if 2.3000000000000001e-140 < y < 1.66e-43Initial program 88.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in t around inf
lower-/.f64N/A
lower-+.f6450.3
Applied rewrites50.3%
Taylor expanded in a around 0
Applied rewrites38.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.3e+92) (/ z b) (if (<= y 1.3e-37) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.3e+92) {
tmp = z / b;
} else if (y <= 1.3e-37) {
tmp = x / (a + 1.0);
} 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 (y <= (-4.3d+92)) then
tmp = z / b
else if (y <= 1.3d-37) then
tmp = x / (a + 1.0d0)
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 (y <= -4.3e+92) {
tmp = z / b;
} else if (y <= 1.3e-37) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.3e+92: tmp = z / b elif y <= 1.3e-37: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.3e+92) tmp = Float64(z / b); elseif (y <= 1.3e-37) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.3e+92) tmp = z / b; elseif (y <= 1.3e-37) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.3e+92], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.3e-37], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+92}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -4.2999999999999998e92 or 1.2999999999999999e-37 < y Initial program 48.5%
Taylor expanded in y around inf
lower-/.f6456.3
Applied rewrites56.3%
if -4.2999999999999998e92 < y < 1.2999999999999999e-37Initial program 90.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6452.8
Applied rewrites52.8%
Final simplification54.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.5e-156) (/ z b) (if (<= y 1.66e-43) (- x (* x a)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.5e-156) {
tmp = z / b;
} else if (y <= 1.66e-43) {
tmp = x - (x * a);
} 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 (y <= (-2.5d-156)) then
tmp = z / b
else if (y <= 1.66d-43) then
tmp = x - (x * a)
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 (y <= -2.5e-156) {
tmp = z / b;
} else if (y <= 1.66e-43) {
tmp = x - (x * a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.5e-156: tmp = z / b elif y <= 1.66e-43: tmp = x - (x * a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.5e-156) tmp = Float64(z / b); elseif (y <= 1.66e-43) tmp = Float64(x - Float64(x * a)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.5e-156) tmp = z / b; elseif (y <= 1.66e-43) tmp = x - (x * a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.5e-156], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.66e-43], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-156}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{-43}:\\
\;\;\;\;x - x \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.50000000000000004e-156 or 1.66e-43 < y Initial program 61.8%
Taylor expanded in y around inf
lower-/.f6445.6
Applied rewrites45.6%
if -2.50000000000000004e-156 < y < 1.66e-43Initial program 90.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.8
Applied rewrites77.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower-+.f6457.7
Applied rewrites57.7%
Taylor expanded in a around 0
Applied rewrites26.7%
(FPCore (x y z t a b) :precision binary64 (- x (* x a)))
double code(double x, double y, double z, double t, double a, double b) {
return x - (x * 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 = x - (x * a)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x - (x * a);
}
def code(x, y, z, t, a, b): return x - (x * a)
function code(x, y, z, t, a, b) return Float64(x - Float64(x * a)) end
function tmp = code(x, y, z, t, a, b) tmp = x - (x * a); end
code[x_, y_, z_, t_, a_, b_] := N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - x \cdot a
\end{array}
Initial program 72.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-+.f6436.0
Applied rewrites36.0%
Taylor expanded in a around 0
Applied rewrites15.8%
(FPCore (x y z t a b) :precision binary64 (* x (- a)))
double code(double x, double y, double z, double t, double a, double b) {
return x * -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 = x * -a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * -a;
}
def code(x, y, z, t, a, b): return x * -a
function code(x, y, z, t, a, b) return Float64(x * Float64(-a)) end
function tmp = code(x, y, z, t, a, b) tmp = x * -a; end
code[x_, y_, z_, t_, a_, b_] := N[(x * (-a)), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-a\right)
\end{array}
Initial program 72.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-+.f6436.0
Applied rewrites36.0%
Taylor expanded in a around 0
Applied rewrites15.8%
Taylor expanded in a around inf
Applied rewrites4.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024226
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))