
(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 17 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 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 -5e+259)
(fma y (/ z (fma t (fma y (/ b t) a) t)) (/ x (+ a 1.0)))
(if (<= t_1 5e+271) t_1 (fma t (/ x (* y b)) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -5e+259) {
tmp = fma(y, (z / fma(t, fma(y, (b / t), a), t)), (x / (a + 1.0)));
} else if (t_1 <= 5e+271) {
tmp = t_1;
} else {
tmp = fma(t, (x / (y * b)), (z / b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= -5e+259) tmp = fma(y, Float64(z / fma(t, fma(y, Float64(b / t), a), t)), Float64(x / Float64(a + 1.0))); elseif (t_1 <= 5e+271) tmp = t_1; else tmp = fma(t, Float64(x / Float64(y * b)), Float64(z / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+259], N[(y * N[(z / N[(t * N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+271], t$95$1, N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+259}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t}, a\right), t\right)}, \frac{x}{a + 1}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+271}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{y \cdot b}, \frac{z}{b}\right)\\
\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))) < -5.00000000000000033e259Initial program 35.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
Simplified86.7%
Taylor expanded in y around 0
Simplified86.7%
if -5.00000000000000033e259 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.0000000000000003e271Initial program 89.6%
if 5.0000000000000003e271 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 6.3%
Taylor expanded in y around inf
sub-negN/A
associate-+l+N/A
sub-negN/A
associate-/l*N/A
associate-/l*N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified62.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-lowering-*.f6484.6
Simplified84.6%
Final simplification88.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (/ x (+ a 1.0))))
(if (<= t_1 (- INFINITY))
(* y (/ z (fma b y t)))
(if (<= t_1 -2e-298)
t_2
(if (<= t_1 5e-251)
(/ x (fma b (/ y t) a))
(if (<= t_1 1e+245)
t_2
(if (<= t_1 INFINITY) (* z (/ y (fma t a t))) (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = x / (a + 1.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / fma(b, y, t));
} else if (t_1 <= -2e-298) {
tmp = t_2;
} else if (t_1 <= 5e-251) {
tmp = x / fma(b, (y / t), a);
} else if (t_1 <= 1e+245) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = z * (y / fma(t, a, t));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(b, y, t))); elseif (t_1 <= -2e-298) tmp = t_2; elseif (t_1 <= 5e-251) tmp = Float64(x / fma(b, Float64(y / t), a)); elseif (t_1 <= 1e+245) tmp = t_2; elseif (t_1 <= Inf) tmp = Float64(z * Float64(y / fma(t, a, t))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-298], t$95$2, If[LessEqual[t$95$1, 5e-251], N[(x / N[(b * N[(y / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+245], t$95$2, If[LessEqual[t$95$1, Infinity], N[(z * N[(y / N[(t * a + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := \frac{x}{a + 1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(b, y, t\right)}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-298}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-251}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}\\
\mathbf{elif}\;t\_1 \leq 10^{+245}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;z \cdot \frac{y}{\mathsf{fma}\left(t, a, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{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 25.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6444.5
Simplified44.5%
Taylor expanded in a around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6469.1
Simplified69.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.99999999999999982e-298 or 5.0000000000000003e-251 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.00000000000000004e245Initial program 99.1%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6457.2
Simplified57.2%
if -1.99999999999999982e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.0000000000000003e-251Initial program 54.3%
/-lowering-/.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6461.2
Applied egg-rr61.2%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6458.5
Simplified58.5%
Taylor expanded in a around inf
Simplified58.5%
if 1.00000000000000004e245 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 48.8%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6455.9
Simplified55.9%
Taylor expanded in z around inf
distribute-rgt-inN/A
*-lft-identityN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6447.1
Simplified47.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f6462.3
Applied egg-rr62.3%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
Taylor expanded in y around inf
/-lowering-/.f6496.7
Simplified96.7%
Final simplification62.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (/ x (+ a 1.0))))
(if (<= t_1 (- INFINITY))
(* y (/ z (fma b y t)))
(if (<= t_1 -2e-298)
t_2
(if (<= t_1 0.0)
(/ z b)
(if (<= t_1 1e+245)
t_2
(if (<= t_1 INFINITY) (* z (/ y (fma t a t))) (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = x / (a + 1.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / fma(b, y, t));
} else if (t_1 <= -2e-298) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = z / b;
} else if (t_1 <= 1e+245) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = z * (y / fma(t, a, t));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(b, y, t))); elseif (t_1 <= -2e-298) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(z / b); elseif (t_1 <= 1e+245) tmp = t_2; elseif (t_1 <= Inf) tmp = Float64(z * Float64(y / fma(t, a, t))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-298], t$95$2, If[LessEqual[t$95$1, 0.0], N[(z / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+245], t$95$2, If[LessEqual[t$95$1, Infinity], N[(z * N[(y / N[(t * a + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := \frac{x}{a + 1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(b, y, t\right)}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-298}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t\_1 \leq 10^{+245}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;z \cdot \frac{y}{\mathsf{fma}\left(t, a, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{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 25.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6444.5
Simplified44.5%
Taylor expanded in a around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6469.1
Simplified69.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.99999999999999982e-298 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.00000000000000004e245Initial program 98.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6456.4
Simplified56.4%
if -1.99999999999999982e-298 < (/.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 29.9%
Taylor expanded in y around inf
/-lowering-/.f6473.1
Simplified73.1%
if 1.00000000000000004e245 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 48.8%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6455.9
Simplified55.9%
Taylor expanded in z around inf
distribute-rgt-inN/A
*-lft-identityN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6447.1
Simplified47.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f6462.3
Applied egg-rr62.3%
Final simplification62.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))) (t_2 (/ t_1 (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_2 (- INFINITY))
(* y (/ z (fma t (fma y (/ b t) a) t)))
(if (<= t_2 -2e-298)
(/ t_1 (+ a 1.0))
(if (<= t_2 0.0)
(/ (fma t (/ x y) z) b)
(if (<= t_2 5e+271)
(/ (fma z (/ y t) x) (+ a 1.0))
(fma t (/ x (* y b)) (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y * (z / fma(t, fma(y, (b / t), a), t));
} else if (t_2 <= -2e-298) {
tmp = t_1 / (a + 1.0);
} else if (t_2 <= 0.0) {
tmp = fma(t, (x / y), z) / b;
} else if (t_2 <= 5e+271) {
tmp = fma(z, (y / t), x) / (a + 1.0);
} else {
tmp = fma(t, (x / (y * b)), (z / b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(t, fma(y, Float64(b / t), a), t))); elseif (t_2 <= -2e-298) tmp = Float64(t_1 / Float64(a + 1.0)); elseif (t_2 <= 0.0) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (t_2 <= 5e+271) tmp = Float64(fma(z, Float64(y / t), x) / Float64(a + 1.0)); else tmp = fma(t, Float64(x / Float64(y * b)), Float64(z / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y * N[(z / N[(t * N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-298], N[(t$95$1 / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$2, 5e+271], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t}, a\right), t\right)}\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-298}:\\
\;\;\;\;\frac{t\_1}{a + 1}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+271}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{y \cdot b}, \frac{z}{b}\right)\\
\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 25.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6444.5
Simplified44.5%
associate-*r/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6484.4
Applied egg-rr84.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.99999999999999982e-298Initial program 99.6%
Taylor expanded in y around 0
+-lowering-+.f6482.9
Simplified82.9%
if -1.99999999999999982e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 52.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
Simplified57.1%
Taylor expanded in b around inf
/-lowering-/.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6472.1
Simplified72.1%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.0000000000000003e271Initial program 97.3%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6484.1
Simplified84.1%
if 5.0000000000000003e271 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 6.3%
Taylor expanded in y around inf
sub-negN/A
associate-+l+N/A
sub-negN/A
associate-/l*N/A
associate-/l*N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified62.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-lowering-*.f6484.6
Simplified84.6%
Final simplification82.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (/ x (+ a 1.0))))
(if (<= t_1 (- INFINITY))
(* y (/ z (fma b y t)))
(if (<= t_1 -2e-298)
t_2
(if (<= t_1 0.0) (/ z b) (if (<= t_1 1e+245) t_2 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = x / (a + 1.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / fma(b, y, t));
} else if (t_1 <= -2e-298) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = z / b;
} else if (t_1 <= 1e+245) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(b, y, t))); elseif (t_1 <= -2e-298) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(z / b); elseif (t_1 <= 1e+245) tmp = t_2; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-298], t$95$2, If[LessEqual[t$95$1, 0.0], N[(z / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+245], t$95$2, N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := \frac{x}{a + 1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(b, y, t\right)}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-298}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t\_1 \leq 10^{+245}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{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 25.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6444.5
Simplified44.5%
Taylor expanded in a around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6469.1
Simplified69.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.99999999999999982e-298 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.00000000000000004e245Initial program 98.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6456.4
Simplified56.4%
if -1.99999999999999982e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0 or 1.00000000000000004e245 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 33.0%
Taylor expanded in y around inf
/-lowering-/.f6465.5
Simplified65.5%
Final simplification60.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (/ (fma z (/ y t) x) (+ a 1.0))))
(if (<= t_1 -2e-298)
t_2
(if (<= t_1 0.0)
(/ (fma t (/ x y) z) b)
(if (<= t_1 5e+271) t_2 (fma t (/ x (* y b)) (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = fma(z, (y / t), x) / (a + 1.0);
double tmp;
if (t_1 <= -2e-298) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = fma(t, (x / y), z) / b;
} else if (t_1 <= 5e+271) {
tmp = t_2;
} else {
tmp = fma(t, (x / (y * b)), (z / b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(fma(z, Float64(y / t), x) / Float64(a + 1.0)) tmp = 0.0 if (t_1 <= -2e-298) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (t_1 <= 5e+271) tmp = t_2; else tmp = fma(t, Float64(x / Float64(y * b)), Float64(z / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-298], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 5e+271], t$95$2, N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a + 1}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-298}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+271}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{y \cdot b}, \frac{z}{b}\right)\\
\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))) < -1.99999999999999982e-298 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.0000000000000003e271Initial program 90.9%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6479.8
Simplified79.8%
if -1.99999999999999982e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 52.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
Simplified57.1%
Taylor expanded in b around inf
/-lowering-/.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6472.1
Simplified72.1%
if 5.0000000000000003e271 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 6.3%
Taylor expanded in y around inf
sub-negN/A
associate-+l+N/A
sub-negN/A
associate-/l*N/A
associate-/l*N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified62.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-lowering-*.f6484.6
Simplified84.6%
Final simplification79.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (/ (fma z (/ y t) x) (+ a 1.0))))
(if (<= t_1 -2e-298)
t_2
(if (<= t_1 0.0)
(/ (fma t (/ x y) z) b)
(if (<= t_1 INFINITY) t_2 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = fma(z, (y / t), x) / (a + 1.0);
double tmp;
if (t_1 <= -2e-298) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = fma(t, (x / y), z) / b;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(fma(z, Float64(y / t), x) / Float64(a + 1.0)) tmp = 0.0 if (t_1 <= -2e-298) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-298], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a + 1}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-298}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{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))) < -1.99999999999999982e-298 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.8%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6478.2
Simplified78.2%
if -1.99999999999999982e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 52.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
Simplified57.1%
Taylor expanded in b around inf
/-lowering-/.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6472.1
Simplified72.1%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
Taylor expanded in y around inf
/-lowering-/.f6496.7
Simplified96.7%
Final simplification79.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(* y (/ z (fma t (fma y (/ b t) a) t)))
(if (<= t_1 5e+271) t_1 (fma t (/ x (* y b)) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / fma(t, fma(y, (b / t), a), t));
} else if (t_1 <= 5e+271) {
tmp = t_1;
} else {
tmp = fma(t, (x / (y * b)), (z / b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / fma(t, fma(y, Float64(b / t), a), t))); elseif (t_1 <= 5e+271) tmp = t_1; else tmp = fma(t, Float64(x / Float64(y * b)), Float64(z / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / N[(t * N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+271], t$95$1, N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t}, a\right), t\right)}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+271}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{y \cdot b}, \frac{z}{b}\right)\\
\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 25.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6444.5
Simplified44.5%
associate-*r/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6484.4
Applied egg-rr84.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.0000000000000003e271Initial program 89.7%
if 5.0000000000000003e271 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 6.3%
Taylor expanded in y around inf
sub-negN/A
associate-+l+N/A
sub-negN/A
associate-/l*N/A
associate-/l*N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified62.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-lowering-*.f6484.6
Simplified84.6%
Final simplification88.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))) INFINITY) (/ (fma y (/ z t) x) (+ a (fma y (/ b t) 1.0))) (fma t (/ x (* y b)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0))) <= ((double) INFINITY)) {
tmp = fma(y, (z / t), x) / (a + fma(y, (b / t), 1.0));
} else {
tmp = fma(t, (x / (y * b)), (z / b));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) <= Inf) tmp = Float64(fma(y, Float64(z / t), x) / Float64(a + fma(y, Float64(b / t), 1.0))); else tmp = fma(t, Float64(x / Float64(y * b)), Float64(z / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(a + N[(y * N[(b / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a + \mathsf{fma}\left(y, \frac{b}{t}, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{y \cdot b}, \frac{z}{b}\right)\\
\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 81.8%
/-lowering-/.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6480.9
Applied egg-rr80.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
Taylor expanded in y around inf
sub-negN/A
associate-+l+N/A
sub-negN/A
associate-/l*N/A
associate-/l*N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified75.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-lowering-*.f6496.7
Simplified96.7%
Final simplification82.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (fma y (/ b t) a)))))
(if (<= t -2.2e+20)
t_1
(if (<= t 1.65e-20) (/ (* y z) (fma b y (fma t a t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + fma(y, (b / t), a));
double tmp;
if (t <= -2.2e+20) {
tmp = t_1;
} else if (t <= 1.65e-20) {
tmp = (y * z) / fma(b, y, fma(t, a, t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + fma(y, Float64(b / t), a))) tmp = 0.0 if (t <= -2.2e+20) tmp = t_1; elseif (t <= 1.65e-20) tmp = Float64(Float64(y * z) / fma(b, y, fma(t, a, t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e+20], t$95$1, If[LessEqual[t, 1.65e-20], N[(N[(y * z), $MachinePrecision] / N[(b * y + N[(t * a + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-20}:\\
\;\;\;\;\frac{y \cdot z}{\mathsf{fma}\left(b, y, \mathsf{fma}\left(t, a, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.2e20 or 1.65e-20 < t Initial program 84.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6470.6
Simplified70.6%
if -2.2e20 < t < 1.65e-20Initial program 63.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6447.3
Simplified47.3%
Taylor expanded in t around 0
distribute-rgt-inN/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6459.2
Simplified59.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma z (/ y t) x)) (t_2 (/ t_1 a))) (if (<= a -0.98) t_2 (if (<= a 225000.0) (* t_1 (- 1.0 a)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (y / t), x);
double t_2 = t_1 / a;
double tmp;
if (a <= -0.98) {
tmp = t_2;
} else if (a <= 225000.0) {
tmp = t_1 * (1.0 - a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(y / t), x) t_2 = Float64(t_1 / a) tmp = 0.0 if (a <= -0.98) tmp = t_2; elseif (a <= 225000.0) tmp = Float64(t_1 * Float64(1.0 - a)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / a), $MachinePrecision]}, If[LessEqual[a, -0.98], t$95$2, If[LessEqual[a, 225000.0], N[(t$95$1 * N[(1.0 - a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y}{t}, x\right)\\
t_2 := \frac{t\_1}{a}\\
\mathbf{if}\;a \leq -0.98:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 225000:\\
\;\;\;\;t\_1 \cdot \left(1 - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -0.97999999999999998 or 225000 < a Initial program 70.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6465.1
Simplified65.1%
if -0.97999999999999998 < a < 225000Initial program 75.2%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.2
Simplified60.2%
div-invN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6460.2
Applied egg-rr60.2%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6460.2
Simplified60.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -4e+20)
t_1
(if (<= t 4.6e+65) (/ (* y z) (fma b y (fma t a t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -4e+20) {
tmp = t_1;
} else if (t <= 4.6e+65) {
tmp = (y * z) / fma(b, y, fma(t, a, t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -4e+20) tmp = t_1; elseif (t <= 4.6e+65) tmp = Float64(Float64(y * z) / fma(b, y, fma(t, a, t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e+20], t$95$1, If[LessEqual[t, 4.6e+65], N[(N[(y * z), $MachinePrecision] / N[(b * y + N[(t * a + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -4 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+65}:\\
\;\;\;\;\frac{y \cdot z}{\mathsf{fma}\left(b, y, \mathsf{fma}\left(t, a, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4e20 or 4.6e65 < t Initial program 82.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6468.1
Simplified68.1%
if -4e20 < t < 4.6e65Initial program 66.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6447.1
Simplified47.1%
Taylor expanded in t around 0
distribute-rgt-inN/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6457.8
Simplified57.8%
Final simplification61.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -9.2e+198)
(/ x a)
(if (<= t -9.2e+14)
(- x (* x a))
(if (<= t 2.4e-16) (/ z b) (if (<= t 2.9e+85) (/ x a) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.2e+198) {
tmp = x / a;
} else if (t <= -9.2e+14) {
tmp = x - (x * a);
} else if (t <= 2.4e-16) {
tmp = z / b;
} else if (t <= 2.9e+85) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-9.2d+198)) then
tmp = x / a
else if (t <= (-9.2d+14)) then
tmp = x - (x * a)
else if (t <= 2.4d-16) then
tmp = z / b
else if (t <= 2.9d+85) then
tmp = x / a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.2e+198) {
tmp = x / a;
} else if (t <= -9.2e+14) {
tmp = x - (x * a);
} else if (t <= 2.4e-16) {
tmp = z / b;
} else if (t <= 2.9e+85) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.2e+198: tmp = x / a elif t <= -9.2e+14: tmp = x - (x * a) elif t <= 2.4e-16: tmp = z / b elif t <= 2.9e+85: tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.2e+198) tmp = Float64(x / a); elseif (t <= -9.2e+14) tmp = Float64(x - Float64(x * a)); elseif (t <= 2.4e-16) tmp = Float64(z / b); elseif (t <= 2.9e+85) tmp = Float64(x / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.2e+198) tmp = x / a; elseif (t <= -9.2e+14) tmp = x - (x * a); elseif (t <= 2.4e-16) tmp = z / b; elseif (t <= 2.9e+85) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.2e+198], N[(x / a), $MachinePrecision], If[LessEqual[t, -9.2e+14], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-16], N[(z / b), $MachinePrecision], If[LessEqual[t, 2.9e+85], N[(x / a), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+198}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{+14}:\\
\;\;\;\;x - x \cdot a\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.2000000000000002e198 or 2.40000000000000005e-16 < t < 2.89999999999999997e85Initial program 81.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6458.3
Simplified58.3%
Taylor expanded in a around inf
/-lowering-/.f6442.4
Simplified42.4%
if -9.2000000000000002e198 < t < -9.2e14Initial program 99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6465.8
Simplified65.8%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6445.5
Simplified45.5%
if -9.2e14 < t < 2.40000000000000005e-16Initial program 62.5%
Taylor expanded in y around inf
/-lowering-/.f6448.0
Simplified48.0%
if 2.89999999999999997e85 < t Initial program 80.2%
Taylor expanded in a around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6458.8
Simplified58.8%
Taylor expanded in y around 0
Simplified42.9%
Final simplification45.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -7.5e+160)
(/ z b)
(if (<= y -6.7e+25)
(fma y (/ z t) x)
(if (<= y 9.5e+61) (/ x (+ a 1.0)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.5e+160) {
tmp = z / b;
} else if (y <= -6.7e+25) {
tmp = fma(y, (z / t), x);
} else if (y <= 9.5e+61) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.5e+160) tmp = Float64(z / b); elseif (y <= -6.7e+25) tmp = fma(y, Float64(z / t), x); elseif (y <= 9.5e+61) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.5e+160], N[(z / b), $MachinePrecision], If[LessEqual[y, -6.7e+25], N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 9.5e+61], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+160}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -6.7 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, x\right)\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+61}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -7.50000000000000028e160 or 9.49999999999999959e61 < y Initial program 41.4%
Taylor expanded in y around inf
/-lowering-/.f6459.4
Simplified59.4%
if -7.50000000000000028e160 < y < -6.70000000000000037e25Initial program 66.6%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6476.0
Simplified76.0%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6456.4
Simplified56.4%
if -6.70000000000000037e25 < y < 9.49999999999999959e61Initial program 92.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6458.2
Simplified58.2%
Final simplification58.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (+ a 1.0)))) (if (<= t -4.6e-15) t_1 (if (<= t 9.5e-17) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -4.6e-15) {
tmp = t_1;
} else if (t <= 9.5e-17) {
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 = x / (a + 1.0d0)
if (t <= (-4.6d-15)) then
tmp = t_1
else if (t <= 9.5d-17) 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 = x / (a + 1.0);
double tmp;
if (t <= -4.6e-15) {
tmp = t_1;
} else if (t <= 9.5e-17) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -4.6e-15: tmp = t_1 elif t <= 9.5e-17: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -4.6e-15) tmp = t_1; elseif (t <= 9.5e-17) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -4.6e-15) tmp = t_1; elseif (t <= 9.5e-17) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e-15], t$95$1, If[LessEqual[t, 9.5e-17], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.59999999999999981e-15 or 9.50000000000000029e-17 < t Initial program 83.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6463.3
Simplified63.3%
if -4.59999999999999981e-15 < t < 9.50000000000000029e-17Initial program 62.3%
Taylor expanded in y around inf
/-lowering-/.f6449.2
Simplified49.2%
Final simplification56.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1900.0) (/ x a) (if (<= a 225000.0) (- x (* x a)) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1900.0) {
tmp = x / a;
} else if (a <= 225000.0) {
tmp = x - (x * a);
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1900.0d0)) then
tmp = x / a
else if (a <= 225000.0d0) then
tmp = x - (x * a)
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1900.0) {
tmp = x / a;
} else if (a <= 225000.0) {
tmp = x - (x * a);
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1900.0: tmp = x / a elif a <= 225000.0: tmp = x - (x * a) else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1900.0) tmp = Float64(x / a); elseif (a <= 225000.0) tmp = Float64(x - Float64(x * a)); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1900.0) tmp = x / a; elseif (a <= 225000.0) tmp = x - (x * a); else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1900.0], N[(x / a), $MachinePrecision], If[LessEqual[a, 225000.0], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1900:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 225000:\\
\;\;\;\;x - x \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1900 or 225000 < a Initial program 70.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6443.3
Simplified43.3%
Taylor expanded in a around inf
/-lowering-/.f6442.9
Simplified42.9%
if -1900 < a < 225000Initial program 74.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6437.9
Simplified37.9%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6437.9
Simplified37.9%
Final simplification40.4%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return 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 = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 72.9%
Taylor expanded in a around 0
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6442.1
Simplified42.1%
Taylor expanded in y around 0
Simplified20.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 2024195
(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))))