
(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 (+ (/ (* b y) t) (+ 1.0 a))) (t_2 (/ (+ (/ (* z y) t) x) t_1)))
(if (<= t_2 (- INFINITY))
(* (/ y (fma (fma (/ b t) y a) t t)) z)
(if (<= t_2 -4e-311)
t_2
(if (<= t_2 0.0)
(/ (fma (- (/ x b) (* (/ z (* b b)) (+ 1.0 a))) t (* (/ z b) y)) y)
(if (<= t_2 2e+288)
(/ (fma (/ 1.0 t) (* z y) x) t_1)
(/ (fma t (/ x y) z) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b * y) / t) + (1.0 + a);
double t_2 = (((z * y) / t) + x) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y / fma(fma((b / t), y, a), t, t)) * z;
} else if (t_2 <= -4e-311) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = fma(((x / b) - ((z / (b * b)) * (1.0 + a))), t, ((z / b) * y)) / y;
} else if (t_2 <= 2e+288) {
tmp = fma((1.0 / t), (z * y), x) / t_1;
} else {
tmp = fma(t, (x / y), z) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a)) t_2 = Float64(Float64(Float64(Float64(z * y) / t) + x) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y / fma(fma(Float64(b / t), y, a), t, t)) * z); elseif (t_2 <= -4e-311) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(fma(Float64(Float64(x / b) - Float64(Float64(z / Float64(b * b)) * Float64(1.0 + a))), t, Float64(Float64(z / b) * y)) / y); elseif (t_2 <= 2e+288) tmp = Float64(fma(Float64(1.0 / t), Float64(z * y), x) / t_1); else tmp = Float64(fma(t, Float64(x / y), z) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y / N[(N[(N[(b / t), $MachinePrecision] * y + a), $MachinePrecision] * t + t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$2, -4e-311], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(x / b), $MachinePrecision] - N[(N[(z / N[(b * b), $MachinePrecision]), $MachinePrecision] * N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(z / b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$2, 2e+288], N[(N[(N[(1.0 / t), $MachinePrecision] * N[(z * y), $MachinePrecision] + x), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b \cdot y}{t} + \left(1 + a\right)\\
t_2 := \frac{\frac{z \cdot y}{t} + x}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{b}{t}, y, a\right), t, t\right)} \cdot z\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{b} - \frac{z}{b \cdot b} \cdot \left(1 + a\right), t, \frac{z}{b} \cdot y\right)}{y}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{t}, z \cdot y, x\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\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 27.4%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
Applied rewrites93.7%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311Initial program 99.6%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 39.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6463.5
Applied rewrites63.5%
Taylor expanded in y around 0
Applied rewrites74.4%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6499.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.6
Applied rewrites99.6%
if 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 5.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6475.0
Applied rewrites75.0%
Taylor expanded in b around inf
Applied rewrites87.1%
Final simplification93.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ (* z y) t) x))
(t_2 (/ t_1 (+ (/ (* b y) t) (+ 1.0 a))))
(t_3 (/ (fma t (/ x y) z) b)))
(if (<= t_2 (- INFINITY))
(* (/ y (fma (fma (/ b t) y a) t t)) z)
(if (<= t_2 -2e+62)
(/ x (fma b (/ y t) (+ 1.0 a)))
(if (<= t_2 -4e-311)
(/ t_1 (+ 1.0 a))
(if (<= t_2 0.0)
t_3
(if (<= t_2 2e+288)
(/ (fma (/ 1.0 t) (* z y) x) (+ 1.0 a))
t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * y) / t) + x;
double t_2 = t_1 / (((b * y) / t) + (1.0 + a));
double t_3 = fma(t, (x / y), z) / b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y / fma(fma((b / t), y, a), t, t)) * z;
} else if (t_2 <= -2e+62) {
tmp = x / fma(b, (y / t), (1.0 + a));
} else if (t_2 <= -4e-311) {
tmp = t_1 / (1.0 + a);
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 2e+288) {
tmp = fma((1.0 / t), (z * y), x) / (1.0 + a);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * y) / t) + x) t_2 = Float64(t_1 / Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a))) t_3 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y / fma(fma(Float64(b / t), y, a), t, t)) * z); elseif (t_2 <= -2e+62) tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + a))); elseif (t_2 <= -4e-311) tmp = Float64(t_1 / Float64(1.0 + a)); elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 2e+288) tmp = Float64(fma(Float64(1.0 / t), Float64(z * y), x) / Float64(1.0 + a)); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y / N[(N[(N[(b / t), $MachinePrecision] * y + a), $MachinePrecision] * t + t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$2, -2e+62], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -4e-311], N[(t$95$1 / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$3, If[LessEqual[t$95$2, 2e+288], N[(N[(N[(1.0 / t), $MachinePrecision] * N[(z * y), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t} + x\\
t_2 := \frac{t\_1}{\frac{b \cdot y}{t} + \left(1 + a\right)}\\
t_3 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{b}{t}, y, a\right), t, t\right)} \cdot z\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;\frac{t\_1}{1 + a}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{t}, z \cdot y, x\right)}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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 27.4%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
Applied rewrites93.7%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.00000000000000007e62Initial program 99.6%
Taylor expanded in t around 0
lower-/.f6411.8
Applied rewrites11.8%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
if -2.00000000000000007e62 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311Initial program 99.7%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f6488.5
Applied rewrites88.5%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6482.2
Applied rewrites82.2%
Final simplification83.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ (* z y) t) x))
(t_2 (/ t_1 (+ (/ (* b y) t) (+ 1.0 a))))
(t_3 (/ (fma t (/ x y) z) b)))
(if (<= t_2 (- INFINITY))
(* (/ z (fma b y t)) y)
(if (<= t_2 -2e+62)
(/ x (fma b (/ y t) (+ 1.0 a)))
(if (<= t_2 -4e-311)
(/ t_1 (+ 1.0 a))
(if (<= t_2 0.0)
t_3
(if (<= t_2 2e+288)
(/ (fma (/ 1.0 t) (* z y) x) (+ 1.0 a))
t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * y) / t) + x;
double t_2 = t_1 / (((b * y) / t) + (1.0 + a));
double t_3 = fma(t, (x / y), z) / b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z / fma(b, y, t)) * y;
} else if (t_2 <= -2e+62) {
tmp = x / fma(b, (y / t), (1.0 + a));
} else if (t_2 <= -4e-311) {
tmp = t_1 / (1.0 + a);
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 2e+288) {
tmp = fma((1.0 / t), (z * y), x) / (1.0 + a);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * y) / t) + x) t_2 = Float64(t_1 / Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a))) t_3 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z / fma(b, y, t)) * y); elseif (t_2 <= -2e+62) tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + a))); elseif (t_2 <= -4e-311) tmp = Float64(t_1 / Float64(1.0 + a)); elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 2e+288) tmp = Float64(fma(Float64(1.0 / t), Float64(z * y), x) / Float64(1.0 + a)); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z / N[(b * y + t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$2, -2e+62], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -4e-311], N[(t$95$1 / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$3, If[LessEqual[t$95$2, 2e+288], N[(N[(N[(1.0 / t), $MachinePrecision] * N[(z * y), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t} + x\\
t_2 := \frac{t\_1}{\frac{b \cdot y}{t} + \left(1 + a\right)}\\
t_3 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b, y, t\right)} \cdot y\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;\frac{t\_1}{1 + a}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{t}, z \cdot y, x\right)}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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 27.4%
Taylor expanded in t around 0
lower-/.f6464.1
Applied rewrites64.1%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6417.7
Applied rewrites17.7%
Taylor expanded in a around 0
Applied rewrites79.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.00000000000000007e62Initial program 99.6%
Taylor expanded in t around 0
lower-/.f6411.8
Applied rewrites11.8%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
if -2.00000000000000007e62 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311Initial program 99.7%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f6488.5
Applied rewrites88.5%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6482.2
Applied rewrites82.2%
Final simplification82.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ (* z y) t) x))
(t_2 (/ t_1 (+ 1.0 a)))
(t_3 (/ t_1 (+ (/ (* b y) t) (+ 1.0 a))))
(t_4 (/ (fma t (/ x y) z) b)))
(if (<= t_3 (- INFINITY))
(* (/ z (fma b y t)) y)
(if (<= t_3 -2e+62)
(/ x (fma b (/ y t) (+ 1.0 a)))
(if (<= t_3 -4e-311)
t_2
(if (<= t_3 0.0) t_4 (if (<= t_3 2e+288) t_2 t_4)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * y) / t) + x;
double t_2 = t_1 / (1.0 + a);
double t_3 = t_1 / (((b * y) / t) + (1.0 + a));
double t_4 = fma(t, (x / y), z) / b;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (z / fma(b, y, t)) * y;
} else if (t_3 <= -2e+62) {
tmp = x / fma(b, (y / t), (1.0 + a));
} else if (t_3 <= -4e-311) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = t_4;
} else if (t_3 <= 2e+288) {
tmp = t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * y) / t) + x) t_2 = Float64(t_1 / Float64(1.0 + a)) t_3 = Float64(t_1 / Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a))) t_4 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(z / fma(b, y, t)) * y); elseif (t_3 <= -2e+62) tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + a))); elseif (t_3 <= -4e-311) tmp = t_2; elseif (t_3 <= 0.0) tmp = t_4; elseif (t_3 <= 2e+288) tmp = t_2; else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(z / N[(b * y + t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$3, -2e+62], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -4e-311], t$95$2, If[LessEqual[t$95$3, 0.0], t$95$4, If[LessEqual[t$95$3, 2e+288], t$95$2, t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t} + x\\
t_2 := \frac{t\_1}{1 + a}\\
t_3 := \frac{t\_1}{\frac{b \cdot y}{t} + \left(1 + a\right)}\\
t_4 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b, y, t\right)} \cdot y\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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 27.4%
Taylor expanded in t around 0
lower-/.f6464.1
Applied rewrites64.1%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6417.7
Applied rewrites17.7%
Taylor expanded in a around 0
Applied rewrites79.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.00000000000000007e62Initial program 99.6%
Taylor expanded in t around 0
lower-/.f6411.8
Applied rewrites11.8%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
if -2.00000000000000007e62 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f6484.4
Applied rewrites84.4%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
Final simplification82.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (/ (* z y) t) x) (+ (/ (* b y) t) (+ 1.0 a))))
(t_2 (/ (fma t (/ x y) z) b)))
(if (<= t_1 (- INFINITY))
(* (/ z (fma b y t)) y)
(if (<= t_1 -2e+62)
(/ x (fma b (/ y t) (+ 1.0 a)))
(if (<= t_1 -4e-311)
(/ (fma (/ z t) y x) (+ 1.0 a))
(if (<= t_1 0.0)
t_2
(if (<= t_1 2e+288) (/ (fma z (/ y t) x) (+ 1.0 a)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * y) / t) + x) / (((b * y) / t) + (1.0 + a));
double t_2 = fma(t, (x / y), z) / b;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (z / fma(b, y, t)) * y;
} else if (t_1 <= -2e+62) {
tmp = x / fma(b, (y / t), (1.0 + a));
} else if (t_1 <= -4e-311) {
tmp = fma((z / t), y, x) / (1.0 + a);
} else if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 2e+288) {
tmp = fma(z, (y / t), x) / (1.0 + a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * y) / t) + x) / Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a))) t_2 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(z / fma(b, y, t)) * y); elseif (t_1 <= -2e+62) tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + a))); elseif (t_1 <= -4e-311) tmp = Float64(fma(Float64(z / t), y, x) / Float64(1.0 + a)); elseif (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 2e+288) tmp = Float64(fma(z, Float64(y / t), x) / Float64(1.0 + a)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z / N[(b * y + t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, -2e+62], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-311], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], t$95$2, If[LessEqual[t$95$1, 2e+288], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{z \cdot y}{t} + x}{\frac{b \cdot y}{t} + \left(1 + a\right)}\\
t_2 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b, y, t\right)} \cdot y\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{1 + a}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{1 + a}\\
\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 27.4%
Taylor expanded in t around 0
lower-/.f6464.1
Applied rewrites64.1%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6417.7
Applied rewrites17.7%
Taylor expanded in a around 0
Applied rewrites79.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.00000000000000007e62Initial program 99.6%
Taylor expanded in t around 0
lower-/.f6411.8
Applied rewrites11.8%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
if -2.00000000000000007e62 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311Initial program 99.7%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.4
Applied rewrites86.4%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6482.2
Applied rewrites82.2%
Final simplification82.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma (/ z t) y x) (+ 1.0 a)))
(t_2 (/ (+ (/ (* z y) t) x) (+ (/ (* b y) t) (+ 1.0 a))))
(t_3 (/ (fma t (/ x y) z) b)))
(if (<= t_2 (- INFINITY))
(* (/ z (fma b y t)) y)
(if (<= t_2 -2e+62)
(/ x (fma b (/ y t) (+ 1.0 a)))
(if (<= t_2 -4e-311)
t_1
(if (<= t_2 0.0) t_3 (if (<= t_2 2e+288) t_1 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((z / t), y, x) / (1.0 + a);
double t_2 = (((z * y) / t) + x) / (((b * y) / t) + (1.0 + a));
double t_3 = fma(t, (x / y), z) / b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z / fma(b, y, t)) * y;
} else if (t_2 <= -2e+62) {
tmp = x / fma(b, (y / t), (1.0 + a));
} else if (t_2 <= -4e-311) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 2e+288) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(z / t), y, x) / Float64(1.0 + a)) t_2 = Float64(Float64(Float64(Float64(z * y) / t) + x) / Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a))) t_3 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z / fma(b, y, t)) * y); elseif (t_2 <= -2e+62) tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + a))); elseif (t_2 <= -4e-311) tmp = t_1; elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 2e+288) tmp = t_1; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z / N[(b * y + t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$2, -2e+62], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -4e-311], t$95$1, If[LessEqual[t$95$2, 0.0], t$95$3, If[LessEqual[t$95$2, 2e+288], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{1 + a}\\
t_2 := \frac{\frac{z \cdot y}{t} + x}{\frac{b \cdot y}{t} + \left(1 + a\right)}\\
t_3 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b, y, t\right)} \cdot y\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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 27.4%
Taylor expanded in t around 0
lower-/.f6464.1
Applied rewrites64.1%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6417.7
Applied rewrites17.7%
Taylor expanded in a around 0
Applied rewrites79.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.00000000000000007e62Initial program 99.6%
Taylor expanded in t around 0
lower-/.f6411.8
Applied rewrites11.8%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
if -2.00000000000000007e62 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6482.9
Applied rewrites82.9%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
Final simplification82.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ (* b y) t) (+ 1.0 a)))
(t_2 (/ (fma t (/ x y) z) b))
(t_3 (/ (+ (/ (* z y) t) x) t_1)))
(if (<= t_3 (- INFINITY))
(* (/ y (fma (fma (/ b t) y a) t t)) z)
(if (<= t_3 -4e-311)
t_3
(if (<= t_3 0.0)
t_2
(if (<= t_3 2e+288) (/ (fma (/ 1.0 t) (* z y) x) t_1) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b * y) / t) + (1.0 + a);
double t_2 = fma(t, (x / y), z) / b;
double t_3 = (((z * y) / t) + x) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (y / fma(fma((b / t), y, a), t, t)) * z;
} else if (t_3 <= -4e-311) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_2;
} else if (t_3 <= 2e+288) {
tmp = fma((1.0 / t), (z * y), x) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a)) t_2 = Float64(fma(t, Float64(x / y), z) / b) t_3 = Float64(Float64(Float64(Float64(z * y) / t) + x) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(y / fma(fma(Float64(b / t), y, a), t, t)) * z); elseif (t_3 <= -4e-311) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_2; elseif (t_3 <= 2e+288) tmp = Float64(fma(Float64(1.0 / t), Float64(z * 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[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(y / N[(N[(N[(b / t), $MachinePrecision] * y + a), $MachinePrecision] * t + t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$3, -4e-311], t$95$3, If[LessEqual[t$95$3, 0.0], t$95$2, If[LessEqual[t$95$3, 2e+288], N[(N[(N[(1.0 / t), $MachinePrecision] * N[(z * y), $MachinePrecision] + x), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b \cdot y}{t} + \left(1 + a\right)\\
t_2 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_3 := \frac{\frac{z \cdot y}{t} + x}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{b}{t}, y, a\right), t, t\right)} \cdot z\\
\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{t}, z \cdot 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 27.4%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
Applied rewrites93.7%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311Initial program 99.6%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6499.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.6
Applied rewrites99.6%
Final simplification93.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b))
(t_2 (/ (+ (/ (* z y) t) x) (+ (/ (* b y) t) (+ 1.0 a)))))
(if (<= t_2 (- INFINITY))
(* (/ y (fma (fma (/ b t) y a) t t)) z)
(if (<= t_2 -4e-311)
t_2
(if (<= t_2 0.0) t_1 (if (<= t_2 2e+288) t_2 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 = (((z * y) / t) + x) / (((b * y) / t) + (1.0 + a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y / fma(fma((b / t), y, a), t, t)) * z;
} else if (t_2 <= -4e-311) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 2e+288) {
tmp = t_2;
} 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(Float64(Float64(z * y) / t) + x) / Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y / fma(fma(Float64(b / t), y, a), t, t)) * z); elseif (t_2 <= -4e-311) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 2e+288) tmp = t_2; 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[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y / N[(N[(N[(b / t), $MachinePrecision] * y + a), $MachinePrecision] * t + t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$2, -4e-311], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 2e+288], t$95$2, 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{\frac{z \cdot y}{t} + x}{\frac{b \cdot y}{t} + \left(1 + a\right)}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{b}{t}, y, a\right), t, t\right)} \cdot z\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;t\_2\\
\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 27.4%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
Applied rewrites93.7%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
Final simplification93.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ (* b y) t) (+ 1.0 a)))
(t_2 (/ (+ (* (/ z t) y) x) t_1))
(t_3 (/ (+ (/ (* z y) t) x) t_1))
(t_4 (/ (fma t (/ x y) z) b)))
(if (<= t_3 (- INFINITY))
(* (/ y (fma (fma (/ b t) y a) t t)) z)
(if (<= t_3 -4e-311)
t_2
(if (<= t_3 0.0) t_4 (if (<= t_3 2e+288) t_2 t_4))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b * y) / t) + (1.0 + a);
double t_2 = (((z / t) * y) + x) / t_1;
double t_3 = (((z * y) / t) + x) / t_1;
double t_4 = fma(t, (x / y), z) / b;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (y / fma(fma((b / t), y, a), t, t)) * z;
} else if (t_3 <= -4e-311) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = t_4;
} else if (t_3 <= 2e+288) {
tmp = t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(b * y) / t) + Float64(1.0 + a)) t_2 = Float64(Float64(Float64(Float64(z / t) * y) + x) / t_1) t_3 = Float64(Float64(Float64(Float64(z * y) / t) + x) / t_1) t_4 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(y / fma(fma(Float64(b / t), y, a), t, t)) * z); elseif (t_3 <= -4e-311) tmp = t_2; elseif (t_3 <= 0.0) tmp = t_4; elseif (t_3 <= 2e+288) tmp = t_2; else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(y / N[(N[(N[(b / t), $MachinePrecision] * y + a), $MachinePrecision] * t + t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$3, -4e-311], t$95$2, If[LessEqual[t$95$3, 0.0], t$95$4, If[LessEqual[t$95$3, 2e+288], t$95$2, t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b \cdot y}{t} + \left(1 + a\right)\\
t_2 := \frac{\frac{z}{t} \cdot y + x}{t\_1}\\
t_3 := \frac{\frac{z \cdot y}{t} + x}{t\_1}\\
t_4 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{b}{t}, y, a\right), t, t\right)} \cdot z\\
\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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 27.4%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
Applied rewrites93.7%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999979e-311 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6495.0
Applied rewrites95.0%
if -3.99999999999979e-311 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 20.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in b around inf
Applied rewrites81.1%
Final simplification90.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -2.4e+16)
t_1
(if (<= y 3e-147)
(/ x (+ 1.0 a))
(if (<= y 2.45e+82) (/ (fma (/ z t) y x) 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 <= -2.4e+16) {
tmp = t_1;
} else if (y <= 3e-147) {
tmp = x / (1.0 + a);
} else if (y <= 2.45e+82) {
tmp = fma((z / t), y, x) / 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 <= -2.4e+16) tmp = t_1; elseif (y <= 3e-147) tmp = Float64(x / Float64(1.0 + a)); elseif (y <= 2.45e+82) tmp = Float64(fma(Float64(z / t), y, x) / 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, -2.4e+16], t$95$1, If[LessEqual[y, 3e-147], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+82], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / a), $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.4 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-147}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+82}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4e16 or 2.45e82 < y Initial program 46.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6451.9
Applied rewrites51.9%
Taylor expanded in b around inf
Applied rewrites65.4%
if -2.4e16 < y < 3.0000000000000002e-147Initial program 97.1%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6476.3
Applied rewrites76.3%
if 3.0000000000000002e-147 < y < 2.45e82Initial program 80.8%
Taylor expanded in a around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6452.4
Applied rewrites52.4%
Final simplification67.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -6.2e+16)
t_1
(if (<= y 2.45e+82) (/ x (fma b (/ y t) (+ 1.0 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 <= -6.2e+16) {
tmp = t_1;
} else if (y <= 2.45e+82) {
tmp = x / fma(b, (y / t), (1.0 + 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 <= -6.2e+16) tmp = t_1; elseif (y <= 2.45e+82) tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + 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, -6.2e+16], t$95$1, If[LessEqual[y, 2.45e+82], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + 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 -6.2 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.2e16 or 2.45e82 < y Initial program 46.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6451.9
Applied rewrites51.9%
Taylor expanded in b around inf
Applied rewrites65.4%
if -6.2e16 < y < 2.45e82Initial program 92.7%
Taylor expanded in t around 0
lower-/.f6411.4
Applied rewrites11.4%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6473.9
Applied rewrites73.9%
Final simplification69.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (fma t (/ x y) z) b))) (if (<= y -2.4e+16) t_1 (if (<= y 2.2e+82) (/ x (+ 1.0 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 <= -2.4e+16) {
tmp = t_1;
} else if (y <= 2.2e+82) {
tmp = x / (1.0 + 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 <= -2.4e+16) tmp = t_1; elseif (y <= 2.2e+82) tmp = Float64(x / Float64(1.0 + 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, -2.4e+16], t$95$1, If[LessEqual[y, 2.2e+82], N[(x / N[(1.0 + a), $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.4 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4e16 or 2.2000000000000001e82 < y Initial program 46.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6451.9
Applied rewrites51.9%
Taylor expanded in b around inf
Applied rewrites65.4%
if -2.4e16 < y < 2.2000000000000001e82Initial program 92.7%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.2
Applied rewrites65.2%
Final simplification65.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2e+16)
(/ z b)
(if (<= y 1.75e-170)
(fma (- (* a x) x) a x)
(if (<= y 4.1e+91) (/ x a) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2e+16) {
tmp = z / b;
} else if (y <= 1.75e-170) {
tmp = fma(((a * x) - x), a, x);
} else if (y <= 4.1e+91) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2e+16) tmp = Float64(z / b); elseif (y <= 1.75e-170) tmp = fma(Float64(Float64(a * x) - x), a, x); elseif (y <= 4.1e+91) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2e+16], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.75e-170], N[(N[(N[(a * x), $MachinePrecision] - x), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[y, 4.1e+91], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+16}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-170}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot x - x, a, x\right)\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+91}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2e16 or 4.1000000000000002e91 < y Initial program 46.5%
Taylor expanded in t around 0
lower-/.f6456.6
Applied rewrites56.6%
if -2e16 < y < 1.74999999999999992e-170Initial program 97.0%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6475.3
Applied rewrites75.3%
Taylor expanded in a around 0
Applied rewrites48.0%
if 1.74999999999999992e-170 < y < 4.1000000000000002e91Initial program 83.1%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6441.0
Applied rewrites41.0%
Taylor expanded in a around inf
Applied rewrites35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2e+16) (/ z b) (if (<= y 1.75e-170) (/ x 1.0) (if (<= y 4.1e+91) (/ x a) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2e+16) {
tmp = z / b;
} else if (y <= 1.75e-170) {
tmp = x / 1.0;
} else if (y <= 4.1e+91) {
tmp = 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 <= (-2d+16)) then
tmp = z / b
else if (y <= 1.75d-170) then
tmp = x / 1.0d0
else if (y <= 4.1d+91) then
tmp = 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 <= -2e+16) {
tmp = z / b;
} else if (y <= 1.75e-170) {
tmp = x / 1.0;
} else if (y <= 4.1e+91) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2e+16: tmp = z / b elif y <= 1.75e-170: tmp = x / 1.0 elif y <= 4.1e+91: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2e+16) tmp = Float64(z / b); elseif (y <= 1.75e-170) tmp = Float64(x / 1.0); elseif (y <= 4.1e+91) tmp = 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 <= -2e+16) tmp = z / b; elseif (y <= 1.75e-170) tmp = x / 1.0; elseif (y <= 4.1e+91) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2e+16], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.75e-170], N[(x / 1.0), $MachinePrecision], If[LessEqual[y, 4.1e+91], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+16}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-170}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+91}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2e16 or 4.1000000000000002e91 < y Initial program 46.5%
Taylor expanded in t around 0
lower-/.f6456.6
Applied rewrites56.6%
if -2e16 < y < 1.74999999999999992e-170Initial program 97.0%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6475.3
Applied rewrites75.3%
Taylor expanded in a around 0
Applied rewrites47.8%
if 1.74999999999999992e-170 < y < 4.1000000000000002e91Initial program 83.1%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6441.0
Applied rewrites41.0%
Taylor expanded in a around inf
Applied rewrites35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ 1.0 a) -5e+19) (/ x a) (if (<= (+ 1.0 a) 2.0) (fma (- x) a x) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((1.0 + a) <= -5e+19) {
tmp = x / a;
} else if ((1.0 + a) <= 2.0) {
tmp = fma(-x, a, x);
} else {
tmp = x / a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(1.0 + a) <= -5e+19) tmp = Float64(x / a); elseif (Float64(1.0 + a) <= 2.0) tmp = fma(Float64(-x), a, x); else tmp = Float64(x / a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(1.0 + a), $MachinePrecision], -5e+19], N[(x / a), $MachinePrecision], If[LessEqual[N[(1.0 + a), $MachinePrecision], 2.0], N[((-x) * a + x), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 + a \leq -5 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;1 + a \leq 2:\\
\;\;\;\;\mathsf{fma}\left(-x, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if (+.f64 a #s(literal 1 binary64)) < -5e19 or 2 < (+.f64 a #s(literal 1 binary64)) Initial program 74.9%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6444.6
Applied rewrites44.6%
Taylor expanded in a around inf
Applied rewrites44.0%
if -5e19 < (+.f64 a #s(literal 1 binary64)) < 2Initial program 67.2%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6437.3
Applied rewrites37.3%
Taylor expanded in a around 0
Applied rewrites37.2%
Final simplification40.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.2e+16) (/ z b) (if (<= y 2.45e+82) (/ x (+ 1.0 a)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.2e+16) {
tmp = z / b;
} else if (y <= 2.45e+82) {
tmp = x / (1.0 + 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 <= (-6.2d+16)) then
tmp = z / b
else if (y <= 2.45d+82) then
tmp = x / (1.0d0 + 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 <= -6.2e+16) {
tmp = z / b;
} else if (y <= 2.45e+82) {
tmp = x / (1.0 + a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.2e+16: tmp = z / b elif y <= 2.45e+82: tmp = x / (1.0 + a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.2e+16) tmp = Float64(z / b); elseif (y <= 2.45e+82) tmp = Float64(x / Float64(1.0 + 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 <= -6.2e+16) tmp = z / b; elseif (y <= 2.45e+82) tmp = x / (1.0 + a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.2e+16], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.45e+82], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -6.2e16 or 2.45e82 < y Initial program 46.9%
Taylor expanded in t around 0
lower-/.f6456.2
Applied rewrites56.2%
if -6.2e16 < y < 2.45e82Initial program 92.7%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6465.2
Applied rewrites65.2%
Final simplification60.9%
(FPCore (x y z t a b) :precision binary64 (fma (- x) a x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(-x, a, x);
}
function code(x, y, z, t, a, b) return fma(Float64(-x), a, x) end
code[x_, y_, z_, t_, a_, b_] := N[((-x) * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-x, a, x\right)
\end{array}
Initial program 70.7%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6440.6
Applied rewrites40.6%
Taylor expanded in a around 0
Applied rewrites21.4%
(FPCore (x y z t a b) :precision binary64 (* (- a) x))
double code(double x, double y, double z, double t, double a, double b) {
return -a * x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = -a * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -a * x;
}
def code(x, y, z, t, a, b): return -a * x
function code(x, y, z, t, a, b) return Float64(Float64(-a) * x) end
function tmp = code(x, y, z, t, a, b) tmp = -a * x; end
code[x_, y_, z_, t_, a_, b_] := N[((-a) * x), $MachinePrecision]
\begin{array}{l}
\\
\left(-a\right) \cdot x
\end{array}
Initial program 70.7%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f6440.6
Applied rewrites40.6%
Taylor expanded in a around 0
Applied rewrites21.4%
Taylor expanded in a around inf
Applied rewrites3.7%
(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 2024237
(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))))