
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t\_0}}{t\_0}}{t\_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t\_0}}{t\_0}}{t\_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 6e+161)
(/
(*
(pow (+ (+ alpha beta) 2.0) -2.0)
(+ 1.0 (fma beta alpha (+ alpha beta))))
(+ (+ alpha beta) 3.0))
(* (/ alpha beta) (pow beta -1.0))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6e+161) {
tmp = (pow(((alpha + beta) + 2.0), -2.0) * (1.0 + fma(beta, alpha, (alpha + beta)))) / ((alpha + beta) + 3.0);
} else {
tmp = (alpha / beta) * pow(beta, -1.0);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6e+161) tmp = Float64(Float64((Float64(Float64(alpha + beta) + 2.0) ^ -2.0) * Float64(1.0 + fma(beta, alpha, Float64(alpha + beta)))) / Float64(Float64(alpha + beta) + 3.0)); else tmp = Float64(Float64(alpha / beta) * (beta ^ -1.0)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6e+161], N[(N[(N[Power[N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision], -2.0], $MachinePrecision] * N[(1.0 + N[(beta * alpha + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] * N[Power[beta, -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6 \cdot 10^{+161}:\\
\;\;\;\;\frac{{\left(\left(\alpha + \beta\right) + 2\right)}^{-2} \cdot \left(1 + \mathsf{fma}\left(\beta, \alpha, \alpha + \beta\right)\right)}{\left(\alpha + \beta\right) + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{\beta} \cdot {\beta}^{-1}\\
\end{array}
\end{array}
if beta < 6.00000000000000023e161Initial program 97.6%
Applied rewrites96.8%
if 6.00000000000000023e161 < beta Initial program 80.9%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6491.6
Applied rewrites91.6%
Taylor expanded in alpha around inf
Applied rewrites91.6%
Applied rewrites90.7%
Final simplification96.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 9.4e+49)
(/
(/ (+ 1.0 (fma beta alpha (+ alpha beta))) (+ (+ alpha beta) 2.0))
(fma (+ alpha beta) (+ (+ alpha beta) 3.0) (fma 2.0 (+ alpha beta) 6.0)))
(/ (/ (- alpha -1.0) beta) beta)))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9.4e+49) {
tmp = ((1.0 + fma(beta, alpha, (alpha + beta))) / ((alpha + beta) + 2.0)) / fma((alpha + beta), ((alpha + beta) + 3.0), fma(2.0, (alpha + beta), 6.0));
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 9.4e+49) tmp = Float64(Float64(Float64(1.0 + fma(beta, alpha, Float64(alpha + beta))) / Float64(Float64(alpha + beta) + 2.0)) / fma(Float64(alpha + beta), Float64(Float64(alpha + beta) + 3.0), fma(2.0, Float64(alpha + beta), 6.0))); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / beta); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 9.4e+49], N[(N[(N[(1.0 + N[(beta * alpha + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] * N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision] + N[(2.0 * N[(alpha + beta), $MachinePrecision] + 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.4 \cdot 10^{+49}:\\
\;\;\;\;\frac{\frac{1 + \mathsf{fma}\left(\beta, \alpha, \alpha + \beta\right)}{\left(\alpha + \beta\right) + 2}}{\mathsf{fma}\left(\alpha + \beta, \left(\alpha + \beta\right) + 3, \mathsf{fma}\left(2, \alpha + \beta, 6\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 9.3999999999999995e49Initial program 98.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites98.3%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval98.3
Applied rewrites98.3%
if 9.3999999999999995e49 < beta Initial program 86.1%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6485.4
Applied rewrites85.4%
Applied rewrites86.4%
Final simplification95.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ alpha beta) 2.0)))
(if (<= beta 5e+174)
(/
(/
(/ (+ 1.0 (fma beta alpha (+ alpha beta))) t_0)
(+ (+ alpha beta) 3.0))
t_0)
(/ 1.0 (* (/ beta (- alpha -1.0)) beta)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + 2.0;
double tmp;
if (beta <= 5e+174) {
tmp = (((1.0 + fma(beta, alpha, (alpha + beta))) / t_0) / ((alpha + beta) + 3.0)) / t_0;
} else {
tmp = 1.0 / ((beta / (alpha - -1.0)) * beta);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + 2.0) tmp = 0.0 if (beta <= 5e+174) tmp = Float64(Float64(Float64(Float64(1.0 + fma(beta, alpha, Float64(alpha + beta))) / t_0) / Float64(Float64(alpha + beta) + 3.0)) / t_0); else tmp = Float64(1.0 / Float64(Float64(beta / Float64(alpha - -1.0)) * beta)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[beta, 5e+174], N[(N[(N[(N[(1.0 + N[(beta * alpha + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(1.0 / N[(N[(beta / N[(alpha - -1.0), $MachinePrecision]), $MachinePrecision] * beta), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2\\
\mathbf{if}\;\beta \leq 5 \cdot 10^{+174}:\\
\;\;\;\;\frac{\frac{\frac{1 + \mathsf{fma}\left(\beta, \alpha, \alpha + \beta\right)}{t\_0}}{\left(\alpha + \beta\right) + 3}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\beta}{\alpha - -1} \cdot \beta}\\
\end{array}
\end{array}
if beta < 4.9999999999999997e174Initial program 97.2%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites97.2%
if 4.9999999999999997e174 < beta Initial program 81.8%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6496.8
Applied rewrites96.8%
Applied rewrites92.9%
Final simplification96.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ alpha beta) 2.0)))
(if (<= beta 9.4e+49)
(/
(/ (+ 1.0 (fma beta alpha (+ alpha beta))) t_0)
(* (+ (+ alpha beta) 3.0) t_0))
(/ (/ (- alpha -1.0) beta) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + 2.0;
double tmp;
if (beta <= 9.4e+49) {
tmp = ((1.0 + fma(beta, alpha, (alpha + beta))) / t_0) / (((alpha + beta) + 3.0) * t_0);
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + 2.0) tmp = 0.0 if (beta <= 9.4e+49) tmp = Float64(Float64(Float64(1.0 + fma(beta, alpha, Float64(alpha + beta))) / t_0) / Float64(Float64(Float64(alpha + beta) + 3.0) * t_0)); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / beta); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[beta, 9.4e+49], N[(N[(N[(1.0 + N[(beta * alpha + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2\\
\mathbf{if}\;\beta \leq 9.4 \cdot 10^{+49}:\\
\;\;\;\;\frac{\frac{1 + \mathsf{fma}\left(\beta, \alpha, \alpha + \beta\right)}{t\_0}}{\left(\left(\alpha + \beta\right) + 3\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 9.3999999999999995e49Initial program 98.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites98.3%
if 9.3999999999999995e49 < beta Initial program 86.1%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6485.4
Applied rewrites85.4%
Applied rewrites86.4%
Final simplification95.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ alpha beta) 2.0)) (t_1 (+ (+ alpha beta) 3.0)))
(if (<= beta 4.8e-10)
(/ (/ (- alpha -1.0) (fma (+ 4.0 alpha) alpha 4.0)) (+ 1.0 t_0))
(if (<= beta 1.2e+16)
(/ (/ (+ 1.0 beta) (+ 2.0 beta)) (* t_1 t_0))
(/ (/ (- alpha -1.0) t_1) t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + 2.0;
double t_1 = (alpha + beta) + 3.0;
double tmp;
if (beta <= 4.8e-10) {
tmp = ((alpha - -1.0) / fma((4.0 + alpha), alpha, 4.0)) / (1.0 + t_0);
} else if (beta <= 1.2e+16) {
tmp = ((1.0 + beta) / (2.0 + beta)) / (t_1 * t_0);
} else {
tmp = ((alpha - -1.0) / t_1) / t_0;
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + 2.0) t_1 = Float64(Float64(alpha + beta) + 3.0) tmp = 0.0 if (beta <= 4.8e-10) tmp = Float64(Float64(Float64(alpha - -1.0) / fma(Float64(4.0 + alpha), alpha, 4.0)) / Float64(1.0 + t_0)); elseif (beta <= 1.2e+16) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + beta)) / Float64(t_1 * t_0)); else tmp = Float64(Float64(Float64(alpha - -1.0) / t_1) / t_0); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision]}, If[LessEqual[beta, 4.8e-10], N[(N[(N[(alpha - -1.0), $MachinePrecision] / N[(N[(4.0 + alpha), $MachinePrecision] * alpha + 4.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 1.2e+16], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2\\
t_1 := \left(\alpha + \beta\right) + 3\\
\mathbf{if}\;\beta \leq 4.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\mathsf{fma}\left(4 + \alpha, \alpha, 4\right)}}{1 + t\_0}\\
\mathbf{elif}\;\beta \leq 1.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{1 + \beta}{2 + \beta}}{t\_1 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{t\_1}}{t\_0}\\
\end{array}
\end{array}
if beta < 4.8e-10Initial program 99.8%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
lower-+.f6498.1
Applied rewrites98.1%
Taylor expanded in alpha around 0
Applied rewrites98.1%
if 4.8e-10 < beta < 1.2e16Initial program 99.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites97.2%
Taylor expanded in alpha around 0
lower-/.f64N/A
lower-+.f64N/A
lower-+.f6489.9
Applied rewrites89.9%
if 1.2e16 < beta Initial program 85.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites85.7%
Taylor expanded in beta around -inf
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6483.0
Applied rewrites83.0%
Final simplification93.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ alpha beta) 2.0)))
(if (<= beta 9.4e+49)
(/
(+ 1.0 (fma beta alpha (+ alpha beta)))
(* (* (+ (+ alpha beta) 3.0) t_0) t_0))
(/ (/ (- alpha -1.0) beta) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + 2.0;
double tmp;
if (beta <= 9.4e+49) {
tmp = (1.0 + fma(beta, alpha, (alpha + beta))) / ((((alpha + beta) + 3.0) * t_0) * t_0);
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + 2.0) tmp = 0.0 if (beta <= 9.4e+49) tmp = Float64(Float64(1.0 + fma(beta, alpha, Float64(alpha + beta))) / Float64(Float64(Float64(Float64(alpha + beta) + 3.0) * t_0) * t_0)); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / beta); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[beta, 9.4e+49], N[(N[(1.0 + N[(beta * alpha + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2\\
\mathbf{if}\;\beta \leq 9.4 \cdot 10^{+49}:\\
\;\;\;\;\frac{1 + \mathsf{fma}\left(\beta, \alpha, \alpha + \beta\right)}{\left(\left(\left(\alpha + \beta\right) + 3\right) \cdot t\_0\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 9.3999999999999995e49Initial program 98.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites93.5%
if 9.3999999999999995e49 < beta Initial program 86.1%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6485.4
Applied rewrites85.4%
Applied rewrites86.4%
Final simplification91.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ alpha beta) 2.0)))
(if (<= beta 6.2e-15)
(/ (- alpha -1.0) (fma (fma (+ 7.0 alpha) alpha 16.0) alpha 12.0))
(if (<= beta 8.2e+15)
(/ (/ (+ 1.0 beta) (fma (+ 5.0 beta) beta 6.0)) t_0)
(/ (/ (- alpha -1.0) (+ (+ alpha beta) 3.0)) t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + 2.0;
double tmp;
if (beta <= 6.2e-15) {
tmp = (alpha - -1.0) / fma(fma((7.0 + alpha), alpha, 16.0), alpha, 12.0);
} else if (beta <= 8.2e+15) {
tmp = ((1.0 + beta) / fma((5.0 + beta), beta, 6.0)) / t_0;
} else {
tmp = ((alpha - -1.0) / ((alpha + beta) + 3.0)) / t_0;
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + 2.0) tmp = 0.0 if (beta <= 6.2e-15) tmp = Float64(Float64(alpha - -1.0) / fma(fma(Float64(7.0 + alpha), alpha, 16.0), alpha, 12.0)); elseif (beta <= 8.2e+15) tmp = Float64(Float64(Float64(1.0 + beta) / fma(Float64(5.0 + beta), beta, 6.0)) / t_0); else tmp = Float64(Float64(Float64(alpha - -1.0) / Float64(Float64(alpha + beta) + 3.0)) / t_0); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[beta, 6.2e-15], N[(N[(alpha - -1.0), $MachinePrecision] / N[(N[(N[(7.0 + alpha), $MachinePrecision] * alpha + 16.0), $MachinePrecision] * alpha + 12.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 8.2e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(5.0 + beta), $MachinePrecision] * beta + 6.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2\\
\mathbf{if}\;\beta \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\alpha - -1}{\mathsf{fma}\left(\mathsf{fma}\left(7 + \alpha, \alpha, 16\right), \alpha, 12\right)}\\
\mathbf{elif}\;\beta \leq 8.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\mathsf{fma}\left(5 + \beta, \beta, 6\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\left(\alpha + \beta\right) + 3}}{t\_0}\\
\end{array}
\end{array}
if beta < 6.1999999999999998e-15Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.5
Applied rewrites99.5%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6492.3
Applied rewrites92.3%
Taylor expanded in alpha around 0
Applied rewrites92.3%
if 6.1999999999999998e-15 < beta < 8.2e15Initial program 99.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.3%
Taylor expanded in alpha around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f6468.0
Applied rewrites68.0%
Taylor expanded in beta around 0
Applied rewrites68.2%
if 8.2e15 < beta Initial program 85.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites85.7%
Taylor expanded in beta around -inf
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6483.0
Applied rewrites83.0%
Final simplification88.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 6.2e-15)
(/ (- alpha -1.0) (fma (fma (+ 7.0 alpha) alpha 16.0) alpha 12.0))
(if (<= beta 5.6e+15)
(/ (+ 1.0 beta) (* (fma beta (+ (+ 3.0 beta) 2.0) 6.0) (+ 2.0 beta)))
(/ (/ (- alpha -1.0) (+ (+ alpha beta) 3.0)) (+ (+ alpha beta) 2.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.2e-15) {
tmp = (alpha - -1.0) / fma(fma((7.0 + alpha), alpha, 16.0), alpha, 12.0);
} else if (beta <= 5.6e+15) {
tmp = (1.0 + beta) / (fma(beta, ((3.0 + beta) + 2.0), 6.0) * (2.0 + beta));
} else {
tmp = ((alpha - -1.0) / ((alpha + beta) + 3.0)) / ((alpha + beta) + 2.0);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.2e-15) tmp = Float64(Float64(alpha - -1.0) / fma(fma(Float64(7.0 + alpha), alpha, 16.0), alpha, 12.0)); elseif (beta <= 5.6e+15) tmp = Float64(Float64(1.0 + beta) / Float64(fma(beta, Float64(Float64(3.0 + beta) + 2.0), 6.0) * Float64(2.0 + beta))); else tmp = Float64(Float64(Float64(alpha - -1.0) / Float64(Float64(alpha + beta) + 3.0)) / Float64(Float64(alpha + beta) + 2.0)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6.2e-15], N[(N[(alpha - -1.0), $MachinePrecision] / N[(N[(N[(7.0 + alpha), $MachinePrecision] * alpha + 16.0), $MachinePrecision] * alpha + 12.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 5.6e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta * N[(N[(3.0 + beta), $MachinePrecision] + 2.0), $MachinePrecision] + 6.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\alpha - -1}{\mathsf{fma}\left(\mathsf{fma}\left(7 + \alpha, \alpha, 16\right), \alpha, 12\right)}\\
\mathbf{elif}\;\beta \leq 5.6 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\mathsf{fma}\left(\beta, \left(3 + \beta\right) + 2, 6\right) \cdot \left(2 + \beta\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\left(\alpha + \beta\right) + 3}}{\left(\alpha + \beta\right) + 2}\\
\end{array}
\end{array}
if beta < 6.1999999999999998e-15Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.5
Applied rewrites99.5%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6492.3
Applied rewrites92.3%
Taylor expanded in alpha around 0
Applied rewrites92.3%
if 6.1999999999999998e-15 < beta < 5.6e15Initial program 99.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites97.4%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval97.6
Applied rewrites97.6%
Taylor expanded in alpha around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f6467.3
Applied rewrites67.3%
if 5.6e15 < beta Initial program 85.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites85.7%
Taylor expanded in beta around -inf
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6483.0
Applied rewrites83.0%
Final simplification88.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 6.2e-15)
(/ (- alpha -1.0) (fma (fma (+ 7.0 alpha) alpha 16.0) alpha 12.0))
(if (<= beta 1.15e+16)
(/ (+ 1.0 beta) (* (fma beta (+ (+ 3.0 beta) 2.0) 6.0) (+ 2.0 beta)))
(/ (/ (- alpha -1.0) beta) (+ (+ alpha beta) 2.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.2e-15) {
tmp = (alpha - -1.0) / fma(fma((7.0 + alpha), alpha, 16.0), alpha, 12.0);
} else if (beta <= 1.15e+16) {
tmp = (1.0 + beta) / (fma(beta, ((3.0 + beta) + 2.0), 6.0) * (2.0 + beta));
} else {
tmp = ((alpha - -1.0) / beta) / ((alpha + beta) + 2.0);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.2e-15) tmp = Float64(Float64(alpha - -1.0) / fma(fma(Float64(7.0 + alpha), alpha, 16.0), alpha, 12.0)); elseif (beta <= 1.15e+16) tmp = Float64(Float64(1.0 + beta) / Float64(fma(beta, Float64(Float64(3.0 + beta) + 2.0), 6.0) * Float64(2.0 + beta))); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / Float64(Float64(alpha + beta) + 2.0)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6.2e-15], N[(N[(alpha - -1.0), $MachinePrecision] / N[(N[(N[(7.0 + alpha), $MachinePrecision] * alpha + 16.0), $MachinePrecision] * alpha + 12.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 1.15e+16], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta * N[(N[(3.0 + beta), $MachinePrecision] + 2.0), $MachinePrecision] + 6.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\alpha - -1}{\mathsf{fma}\left(\mathsf{fma}\left(7 + \alpha, \alpha, 16\right), \alpha, 12\right)}\\
\mathbf{elif}\;\beta \leq 1.15 \cdot 10^{+16}:\\
\;\;\;\;\frac{1 + \beta}{\mathsf{fma}\left(\beta, \left(3 + \beta\right) + 2, 6\right) \cdot \left(2 + \beta\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\left(\alpha + \beta\right) + 2}\\
\end{array}
\end{array}
if beta < 6.1999999999999998e-15Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.5
Applied rewrites99.5%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6492.3
Applied rewrites92.3%
Taylor expanded in alpha around 0
Applied rewrites92.3%
if 6.1999999999999998e-15 < beta < 1.15e16Initial program 99.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites97.4%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval97.6
Applied rewrites97.6%
Taylor expanded in alpha around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f6467.3
Applied rewrites67.3%
if 1.15e16 < beta Initial program 85.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites85.7%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f6482.5
Applied rewrites82.5%
Final simplification87.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) 2.0))) (if (<= beta 5.0) (/ 0.25 (+ 1.0 t_0)) (/ (/ (- alpha -1.0) beta) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + 2.0;
double tmp;
if (beta <= 5.0) {
tmp = 0.25 / (1.0 + t_0);
} else {
tmp = ((alpha - -1.0) / beta) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = (alpha + beta) + 2.0d0
if (beta <= 5.0d0) then
tmp = 0.25d0 / (1.0d0 + t_0)
else
tmp = ((alpha - (-1.0d0)) / beta) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + 2.0;
double tmp;
if (beta <= 5.0) {
tmp = 0.25 / (1.0 + t_0);
} else {
tmp = ((alpha - -1.0) / beta) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (alpha + beta) + 2.0 tmp = 0 if beta <= 5.0: tmp = 0.25 / (1.0 + t_0) else: tmp = ((alpha - -1.0) / beta) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + 2.0) tmp = 0.0 if (beta <= 5.0) tmp = Float64(0.25 / Float64(1.0 + t_0)); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = (alpha + beta) + 2.0;
tmp = 0.0;
if (beta <= 5.0)
tmp = 0.25 / (1.0 + t_0);
else
tmp = ((alpha - -1.0) / beta) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[beta, 5.0], N[(0.25 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2\\
\mathbf{if}\;\beta \leq 5:\\
\;\;\;\;\frac{0.25}{1 + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{t\_0}\\
\end{array}
\end{array}
if beta < 5Initial program 99.8%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
lower-+.f6497.4
Applied rewrites97.4%
Taylor expanded in alpha around 0
Applied rewrites63.4%
if 5 < beta Initial program 86.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites86.5%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f6479.7
Applied rewrites79.7%
Final simplification68.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.3)
(fma
(fma
(fma 0.024691358024691357 alpha -0.011574074074074073)
alpha
-0.027777777777777776)
alpha
0.08333333333333333)
(if (<= beta 1.35e+154)
(/ (- alpha -1.0) (* beta beta))
(/ (/ alpha beta) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.3) {
tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333);
} else if (beta <= 1.35e+154) {
tmp = (alpha - -1.0) / (beta * beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.3) tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333); elseif (beta <= 1.35e+154) tmp = Float64(Float64(alpha - -1.0) / Float64(beta * beta)); else tmp = Float64(Float64(alpha / beta) / beta); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.3], N[(N[(N[(0.024691358024691357 * alpha + -0.011574074074074073), $MachinePrecision] * alpha + -0.027777777777777776), $MachinePrecision] * alpha + 0.08333333333333333), $MachinePrecision], If[LessEqual[beta, 1.35e+154], N[(N[(alpha - -1.0), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / beta), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.3:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.024691358024691357, \alpha, -0.011574074074074073\right), \alpha, -0.027777777777777776\right), \alpha, 0.08333333333333333\right)\\
\mathbf{elif}\;\beta \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\alpha - -1}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.2999999999999998Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.3
Applied rewrites99.3%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6490.4
Applied rewrites90.4%
Taylor expanded in alpha around 0
Applied rewrites59.9%
if 3.2999999999999998 < beta < 1.35000000000000003e154Initial program 89.4%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6470.7
Applied rewrites70.7%
if 1.35000000000000003e154 < beta Initial program 82.6%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6489.6
Applied rewrites89.6%
Taylor expanded in alpha around inf
Applied rewrites89.6%
Applied rewrites88.8%
Final simplification65.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.5) (/ 0.25 (+ 1.0 (+ (+ alpha beta) 2.0))) (/ (/ (- alpha -1.0) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.5) {
tmp = 0.25 / (1.0 + ((alpha + beta) + 2.0));
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 6.5d0) then
tmp = 0.25d0 / (1.0d0 + ((alpha + beta) + 2.0d0))
else
tmp = ((alpha - (-1.0d0)) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6.5) {
tmp = 0.25 / (1.0 + ((alpha + beta) + 2.0));
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.5: tmp = 0.25 / (1.0 + ((alpha + beta) + 2.0)) else: tmp = ((alpha - -1.0) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.5) tmp = Float64(0.25 / Float64(1.0 + Float64(Float64(alpha + beta) + 2.0))); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6.5)
tmp = 0.25 / (1.0 + ((alpha + beta) + 2.0));
else
tmp = ((alpha - -1.0) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6.5], N[(0.25 / N[(1.0 + N[(N[(alpha + beta), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6.5:\\
\;\;\;\;\frac{0.25}{1 + \left(\left(\alpha + \beta\right) + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 6.5Initial program 99.8%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
lower-+.f6497.4
Applied rewrites97.4%
Taylor expanded in alpha around 0
Applied rewrites63.4%
if 6.5 < beta Initial program 86.5%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
Applied rewrites79.5%
Final simplification68.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.3)
(fma
(fma
(fma 0.024691358024691357 alpha -0.011574074074074073)
alpha
-0.027777777777777776)
alpha
0.08333333333333333)
(/ (/ (- alpha -1.0) beta) beta)))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.3) {
tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333);
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.3) tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / beta); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.3], N[(N[(N[(0.024691358024691357 * alpha + -0.011574074074074073), $MachinePrecision] * alpha + -0.027777777777777776), $MachinePrecision] * alpha + 0.08333333333333333), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.3:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.024691358024691357, \alpha, -0.011574074074074073\right), \alpha, -0.027777777777777776\right), \alpha, 0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.2999999999999998Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.3
Applied rewrites99.3%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6490.4
Applied rewrites90.4%
Taylor expanded in alpha around 0
Applied rewrites59.9%
if 3.2999999999999998 < beta Initial program 86.5%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
Applied rewrites79.5%
Final simplification66.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.3)
(fma
(fma
(fma 0.024691358024691357 alpha -0.011574074074074073)
alpha
-0.027777777777777776)
alpha
0.08333333333333333)
(/ (- alpha -1.0) (* beta beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.3) {
tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333);
} else {
tmp = (alpha - -1.0) / (beta * beta);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.3) tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333); else tmp = Float64(Float64(alpha - -1.0) / Float64(beta * beta)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.3], N[(N[(N[(0.024691358024691357 * alpha + -0.011574074074074073), $MachinePrecision] * alpha + -0.027777777777777776), $MachinePrecision] * alpha + 0.08333333333333333), $MachinePrecision], N[(N[(alpha - -1.0), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.3:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.024691358024691357, \alpha, -0.011574074074074073\right), \alpha, -0.027777777777777776\right), \alpha, 0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha - -1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.2999999999999998Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.3
Applied rewrites99.3%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6490.4
Applied rewrites90.4%
Taylor expanded in alpha around 0
Applied rewrites59.9%
if 3.2999999999999998 < beta Initial program 86.5%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
Final simplification65.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.0)
(fma
(fma
(fma 0.024691358024691357 alpha -0.011574074074074073)
alpha
-0.027777777777777776)
alpha
0.08333333333333333)
(/ 1.0 (* beta beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.0) {
tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.0) tmp = fma(fma(fma(0.024691358024691357, alpha, -0.011574074074074073), alpha, -0.027777777777777776), alpha, 0.08333333333333333); else tmp = Float64(1.0 / Float64(beta * beta)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.0], N[(N[(N[(0.024691358024691357 * alpha + -0.011574074074074073), $MachinePrecision] * alpha + -0.027777777777777776), $MachinePrecision] * alpha + 0.08333333333333333), $MachinePrecision], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.024691358024691357, \alpha, -0.011574074074074073\right), \alpha, -0.027777777777777776\right), \alpha, 0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.3
Applied rewrites99.3%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6490.4
Applied rewrites90.4%
Taylor expanded in alpha around 0
Applied rewrites59.9%
if 3 < beta Initial program 86.5%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in alpha around 0
Applied rewrites75.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.0)
(fma
(fma -0.011574074074074073 alpha -0.027777777777777776)
alpha
0.08333333333333333)
(/ 1.0 (* beta beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.0) {
tmp = fma(fma(-0.011574074074074073, alpha, -0.027777777777777776), alpha, 0.08333333333333333);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.0) tmp = fma(fma(-0.011574074074074073, alpha, -0.027777777777777776), alpha, 0.08333333333333333); else tmp = Float64(1.0 / Float64(beta * beta)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.0], N[(N[(-0.011574074074074073 * alpha + -0.027777777777777776), $MachinePrecision] * alpha + 0.08333333333333333), $MachinePrecision], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.011574074074074073, \alpha, -0.027777777777777776\right), \alpha, 0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval99.3
Applied rewrites99.3%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6490.4
Applied rewrites90.4%
Taylor expanded in alpha around 0
Applied rewrites59.4%
if 3 < beta Initial program 86.5%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in alpha around 0
Applied rewrites75.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 2e+44)
(fma
(fma -0.011574074074074073 alpha -0.027777777777777776)
alpha
0.08333333333333333)
(/ alpha (* beta beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2e+44) {
tmp = fma(fma(-0.011574074074074073, alpha, -0.027777777777777776), alpha, 0.08333333333333333);
} else {
tmp = alpha / (beta * beta);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2e+44) tmp = fma(fma(-0.011574074074074073, alpha, -0.027777777777777776), alpha, 0.08333333333333333); else tmp = Float64(alpha / Float64(beta * beta)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2e+44], N[(N[(-0.011574074074074073 * alpha + -0.027777777777777776), $MachinePrecision] * alpha + 0.08333333333333333), $MachinePrecision], N[(alpha / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.011574074074074073, \alpha, -0.027777777777777776\right), \alpha, 0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.0000000000000002e44Initial program 98.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites98.3%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval98.3
Applied rewrites98.3%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6485.0
Applied rewrites85.0%
Taylor expanded in alpha around 0
Applied rewrites54.6%
if 2.0000000000000002e44 < beta Initial program 86.1%
Taylor expanded in beta around inf
lower-/.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6485.4
Applied rewrites85.4%
Taylor expanded in alpha around inf
Applied rewrites54.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (fma (fma -0.011574074074074073 alpha -0.027777777777777776) alpha 0.08333333333333333))
assert(alpha < beta);
double code(double alpha, double beta) {
return fma(fma(-0.011574074074074073, alpha, -0.027777777777777776), alpha, 0.08333333333333333);
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return fma(fma(-0.011574074074074073, alpha, -0.027777777777777776), alpha, 0.08333333333333333) end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(-0.011574074074074073 * alpha + -0.027777777777777776), $MachinePrecision] * alpha + 0.08333333333333333), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\mathsf{fma}\left(\mathsf{fma}\left(-0.011574074074074073, \alpha, -0.027777777777777776\right), \alpha, 0.08333333333333333\right)
\end{array}
Initial program 95.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites93.7%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval93.7
Applied rewrites93.7%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6467.1
Applied rewrites67.1%
Taylor expanded in alpha around 0
Applied rewrites41.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (fma -0.027777777777777776 alpha 0.08333333333333333))
assert(alpha < beta);
double code(double alpha, double beta) {
return fma(-0.027777777777777776, alpha, 0.08333333333333333);
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return fma(-0.027777777777777776, alpha, 0.08333333333333333) end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(-0.027777777777777776 * alpha + 0.08333333333333333), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\mathsf{fma}\left(-0.027777777777777776, \alpha, 0.08333333333333333\right)
\end{array}
Initial program 95.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites93.7%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval93.7
Applied rewrites93.7%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6467.1
Applied rewrites67.1%
Taylor expanded in alpha around 0
Applied rewrites41.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 95.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites93.7%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
metadata-eval93.7
Applied rewrites93.7%
Taylor expanded in beta around 0
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6467.1
Applied rewrites67.1%
Taylor expanded in alpha around 0
Applied rewrites41.9%
herbie shell --seed 2024327
(FPCore (alpha beta)
:name "Octave 3.8, jcobi/3"
:precision binary64
:pre (and (> alpha -1.0) (> beta -1.0))
(/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) (+ (+ alpha beta) (* 2.0 1.0))) (+ (+ alpha beta) (* 2.0 1.0))) (+ (+ (+ alpha beta) (* 2.0 1.0)) 1.0)))