
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (* i (+ (+ alpha beta) i)))
(t_1 (+ (+ alpha beta) (* 2.0 i)))
(t_2 (* t_1 t_1)))
(/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = i * ((alpha + beta) + i)
t_1 = (alpha + beta) + (2.0d0 * i)
t_2 = t_1 * t_1
code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i): t_0 = i * ((alpha + beta) + i) t_1 = (alpha + beta) + (2.0 * i) t_2 = t_1 * t_1 return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i) t_0 = Float64(i * Float64(Float64(alpha + beta) + i)) t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i)) t_2 = Float64(t_1 * t_1) return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0)) end
function tmp = code(alpha, beta, i) t_0 = i * ((alpha + beta) + i); t_1 = (alpha + beta) + (2.0 * i); t_2 = t_1 * t_1; tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0); end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t\_1 \cdot t\_1\\
\frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (* i (+ (+ alpha beta) i)))
(t_1 (+ (+ alpha beta) (* 2.0 i)))
(t_2 (* t_1 t_1)))
(/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = i * ((alpha + beta) + i)
t_1 = (alpha + beta) + (2.0d0 * i)
t_2 = t_1 * t_1
code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i): t_0 = i * ((alpha + beta) + i) t_1 = (alpha + beta) + (2.0 * i) t_2 = t_1 * t_1 return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i) t_0 = Float64(i * Float64(Float64(alpha + beta) + i)) t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i)) t_2 = Float64(t_1 * t_1) return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0)) end
function tmp = code(alpha, beta, i) t_0 = i * ((alpha + beta) + i); t_1 = (alpha + beta) + (2.0 * i); t_2 = t_1 * t_1; tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0); end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t\_1 \cdot t\_1\\
\frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1}
\end{array}
\end{array}
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (fma 2.0 i (+ beta alpha)))
(t_1 (/ i t_0))
(t_2 (+ (+ beta alpha) i)))
(*
(/ (fma t_1 t_2 (* beta (/ alpha t_0))) (- t_0 1.0))
(/ (* t_2 t_1) (+ 1.0 t_0)))))
double code(double alpha, double beta, double i) {
double t_0 = fma(2.0, i, (beta + alpha));
double t_1 = i / t_0;
double t_2 = (beta + alpha) + i;
return (fma(t_1, t_2, (beta * (alpha / t_0))) / (t_0 - 1.0)) * ((t_2 * t_1) / (1.0 + t_0));
}
function code(alpha, beta, i) t_0 = fma(2.0, i, Float64(beta + alpha)) t_1 = Float64(i / t_0) t_2 = Float64(Float64(beta + alpha) + i) return Float64(Float64(fma(t_1, t_2, Float64(beta * Float64(alpha / t_0))) / Float64(t_0 - 1.0)) * Float64(Float64(t_2 * t_1) / Float64(1.0 + t_0))) end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(2.0 * i + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(i / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(beta + alpha), $MachinePrecision] + i), $MachinePrecision]}, N[(N[(N[(t$95$1 * t$95$2 + N[(beta * N[(alpha / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$2 * t$95$1), $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, i, \beta + \alpha\right)\\
t_1 := \frac{i}{t\_0}\\
t_2 := \left(\beta + \alpha\right) + i\\
\frac{\mathsf{fma}\left(t\_1, t\_2, \beta \cdot \frac{\alpha}{t\_0}\right)}{t\_0 - 1} \cdot \frac{t\_2 \cdot t\_1}{1 + t\_0}
\end{array}
\end{array}
Initial program 13.3%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift--.f64N/A
lift-*.f64N/A
Applied rewrites39.2%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
associate-*r/N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (fma 2.0 i (+ beta alpha))))
(*
(/ (fma (/ i t_0) (+ (+ beta alpha) i) (* beta (/ alpha t_0))) (- t_0 1.0))
(* (/ (+ beta i) (fma 2.0 i beta)) (/ i (+ 1.0 (fma 2.0 i beta)))))))
double code(double alpha, double beta, double i) {
double t_0 = fma(2.0, i, (beta + alpha));
return (fma((i / t_0), ((beta + alpha) + i), (beta * (alpha / t_0))) / (t_0 - 1.0)) * (((beta + i) / fma(2.0, i, beta)) * (i / (1.0 + fma(2.0, i, beta))));
}
function code(alpha, beta, i) t_0 = fma(2.0, i, Float64(beta + alpha)) return Float64(Float64(fma(Float64(i / t_0), Float64(Float64(beta + alpha) + i), Float64(beta * Float64(alpha / t_0))) / Float64(t_0 - 1.0)) * Float64(Float64(Float64(beta + i) / fma(2.0, i, beta)) * Float64(i / Float64(1.0 + fma(2.0, i, beta))))) end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(2.0 * i + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(i / t$95$0), $MachinePrecision] * N[(N[(beta + alpha), $MachinePrecision] + i), $MachinePrecision] + N[(beta * N[(alpha / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(beta + i), $MachinePrecision] / N[(2.0 * i + beta), $MachinePrecision]), $MachinePrecision] * N[(i / N[(1.0 + N[(2.0 * i + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, i, \beta + \alpha\right)\\
\frac{\mathsf{fma}\left(\frac{i}{t\_0}, \left(\beta + \alpha\right) + i, \beta \cdot \frac{\alpha}{t\_0}\right)}{t\_0 - 1} \cdot \left(\frac{\beta + i}{\mathsf{fma}\left(2, i, \beta\right)} \cdot \frac{i}{1 + \mathsf{fma}\left(2, i, \beta\right)}\right)
\end{array}
\end{array}
Initial program 13.3%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift--.f64N/A
lift-*.f64N/A
Applied rewrites39.2%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
associate-*r/N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
Taylor expanded in alpha around 0
times-fracN/A
div-add-revN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6487.1
Applied rewrites87.1%
Applied rewrites87.1%
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (+ beta (* 2.0 i))))
(if (<= beta 1e+160)
0.0625
(*
(/ (+ alpha i) (- (fma 2.0 i (+ beta alpha)) 1.0))
(* (/ i (+ 1.0 t_0)) (/ (+ beta i) t_0))))))
double code(double alpha, double beta, double i) {
double t_0 = beta + (2.0 * i);
double tmp;
if (beta <= 1e+160) {
tmp = 0.0625;
} else {
tmp = ((alpha + i) / (fma(2.0, i, (beta + alpha)) - 1.0)) * ((i / (1.0 + t_0)) * ((beta + i) / t_0));
}
return tmp;
}
function code(alpha, beta, i) t_0 = Float64(beta + Float64(2.0 * i)) tmp = 0.0 if (beta <= 1e+160) tmp = 0.0625; else tmp = Float64(Float64(Float64(alpha + i) / Float64(fma(2.0, i, Float64(beta + alpha)) - 1.0)) * Float64(Float64(i / Float64(1.0 + t_0)) * Float64(Float64(beta + i) / t_0))); end return tmp end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(beta + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1e+160], 0.0625, N[(N[(N[(alpha + i), $MachinePrecision] / N[(N[(2.0 * i + N[(beta + alpha), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(i / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(beta + i), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \beta + 2 \cdot i\\
\mathbf{if}\;\beta \leq 10^{+160}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha + i}{\mathsf{fma}\left(2, i, \beta + \alpha\right) - 1} \cdot \left(\frac{i}{1 + t\_0} \cdot \frac{\beta + i}{t\_0}\right)\\
\end{array}
\end{array}
if beta < 1.00000000000000001e160Initial program 16.6%
Taylor expanded in i around inf
Applied rewrites83.1%
if 1.00000000000000001e160 < beta Initial program 0.0%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift--.f64N/A
lift-*.f64N/A
Applied rewrites27.2%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
associate-*r/N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
Taylor expanded in alpha around 0
times-fracN/A
div-add-revN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6494.0
Applied rewrites94.0%
Taylor expanded in beta around inf
lower-+.f6474.5
Applied rewrites74.5%
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (fma 2.0 i (+ beta alpha))))
(if (<= beta 2.8e+160)
0.0625
(*
(/ (+ alpha i) beta)
(/ (* (+ (+ beta alpha) i) (/ i t_0)) (+ 1.0 t_0))))))
double code(double alpha, double beta, double i) {
double t_0 = fma(2.0, i, (beta + alpha));
double tmp;
if (beta <= 2.8e+160) {
tmp = 0.0625;
} else {
tmp = ((alpha + i) / beta) * ((((beta + alpha) + i) * (i / t_0)) / (1.0 + t_0));
}
return tmp;
}
function code(alpha, beta, i) t_0 = fma(2.0, i, Float64(beta + alpha)) tmp = 0.0 if (beta <= 2.8e+160) tmp = 0.0625; else tmp = Float64(Float64(Float64(alpha + i) / beta) * Float64(Float64(Float64(Float64(beta + alpha) + i) * Float64(i / t_0)) / Float64(1.0 + t_0))); end return tmp end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(2.0 * i + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2.8e+160], 0.0625, N[(N[(N[(alpha + i), $MachinePrecision] / beta), $MachinePrecision] * N[(N[(N[(N[(beta + alpha), $MachinePrecision] + i), $MachinePrecision] * N[(i / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, i, \beta + \alpha\right)\\
\mathbf{if}\;\beta \leq 2.8 \cdot 10^{+160}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha + i}{\beta} \cdot \frac{\left(\left(\beta + \alpha\right) + i\right) \cdot \frac{i}{t\_0}}{1 + t\_0}\\
\end{array}
\end{array}
if beta < 2.8e160Initial program 16.6%
Taylor expanded in i around inf
Applied rewrites82.7%
if 2.8e160 < beta Initial program 0.0%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift--.f64N/A
lift-*.f64N/A
Applied rewrites27.8%
Taylor expanded in beta around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6473.6
Applied rewrites73.6%
Applied rewrites73.6%
(FPCore (alpha beta i) :precision binary64 (if (<= beta 2.8e+160) 0.0625 (* (* (+ alpha i) (/ -1.0 (- beta))) (/ i beta))))
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2.8e+160) {
tmp = 0.0625;
} else {
tmp = ((alpha + i) * (-1.0 / -beta)) * (i / beta);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 2.8d+160) then
tmp = 0.0625d0
else
tmp = ((alpha + i) * ((-1.0d0) / -beta)) * (i / beta)
end if
code = tmp
end function
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2.8e+160) {
tmp = 0.0625;
} else {
tmp = ((alpha + i) * (-1.0 / -beta)) * (i / beta);
}
return tmp;
}
def code(alpha, beta, i): tmp = 0 if beta <= 2.8e+160: tmp = 0.0625 else: tmp = ((alpha + i) * (-1.0 / -beta)) * (i / beta) return tmp
function code(alpha, beta, i) tmp = 0.0 if (beta <= 2.8e+160) tmp = 0.0625; else tmp = Float64(Float64(Float64(alpha + i) * Float64(-1.0 / Float64(-beta))) * Float64(i / beta)); end return tmp end
function tmp_2 = code(alpha, beta, i) tmp = 0.0; if (beta <= 2.8e+160) tmp = 0.0625; else tmp = ((alpha + i) * (-1.0 / -beta)) * (i / beta); end tmp_2 = tmp; end
code[alpha_, beta_, i_] := If[LessEqual[beta, 2.8e+160], 0.0625, N[(N[(N[(alpha + i), $MachinePrecision] * N[(-1.0 / (-beta)), $MachinePrecision]), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8 \cdot 10^{+160}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\alpha + i\right) \cdot \frac{-1}{-\beta}\right) \cdot \frac{i}{\beta}\\
\end{array}
\end{array}
if beta < 2.8e160Initial program 16.6%
Taylor expanded in i around inf
Applied rewrites82.7%
if 2.8e160 < beta Initial program 0.0%
Taylor expanded in beta around inf
*-commutativeN/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
Applied rewrites37.8%
Applied rewrites73.3%
(FPCore (alpha beta i) :precision binary64 (if (<= beta 2.8e+160) 0.0625 (* (/ (+ alpha i) beta) (/ i beta))))
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2.8e+160) {
tmp = 0.0625;
} else {
tmp = ((alpha + i) / beta) * (i / beta);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 2.8d+160) then
tmp = 0.0625d0
else
tmp = ((alpha + i) / beta) * (i / beta)
end if
code = tmp
end function
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2.8e+160) {
tmp = 0.0625;
} else {
tmp = ((alpha + i) / beta) * (i / beta);
}
return tmp;
}
def code(alpha, beta, i): tmp = 0 if beta <= 2.8e+160: tmp = 0.0625 else: tmp = ((alpha + i) / beta) * (i / beta) return tmp
function code(alpha, beta, i) tmp = 0.0 if (beta <= 2.8e+160) tmp = 0.0625; else tmp = Float64(Float64(Float64(alpha + i) / beta) * Float64(i / beta)); end return tmp end
function tmp_2 = code(alpha, beta, i) tmp = 0.0; if (beta <= 2.8e+160) tmp = 0.0625; else tmp = ((alpha + i) / beta) * (i / beta); end tmp_2 = tmp; end
code[alpha_, beta_, i_] := If[LessEqual[beta, 2.8e+160], 0.0625, N[(N[(N[(alpha + i), $MachinePrecision] / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8 \cdot 10^{+160}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}\\
\end{array}
\end{array}
if beta < 2.8e160Initial program 16.6%
Taylor expanded in i around inf
Applied rewrites82.7%
if 2.8e160 < beta Initial program 0.0%
Taylor expanded in beta around inf
*-commutativeN/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
Applied rewrites37.8%
Applied rewrites73.2%
(FPCore (alpha beta i) :precision binary64 (if (<= beta 1.1e+161) 0.0625 (* (/ i beta) (/ i beta))))
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 1.1e+161) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 1.1d+161) then
tmp = 0.0625d0
else
tmp = (i / beta) * (i / beta)
end if
code = tmp
end function
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 1.1e+161) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
def code(alpha, beta, i): tmp = 0 if beta <= 1.1e+161: tmp = 0.0625 else: tmp = (i / beta) * (i / beta) return tmp
function code(alpha, beta, i) tmp = 0.0 if (beta <= 1.1e+161) tmp = 0.0625; else tmp = Float64(Float64(i / beta) * Float64(i / beta)); end return tmp end
function tmp_2 = code(alpha, beta, i) tmp = 0.0; if (beta <= 1.1e+161) tmp = 0.0625; else tmp = (i / beta) * (i / beta); end tmp_2 = tmp; end
code[alpha_, beta_, i_] := If[LessEqual[beta, 1.1e+161], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.1 \cdot 10^{+161}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\
\end{array}
\end{array}
if beta < 1.1e161Initial program 16.6%
Taylor expanded in i around inf
Applied rewrites82.7%
if 1.1e161 < beta Initial program 0.0%
Taylor expanded in beta around inf
*-commutativeN/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
Taylor expanded in alpha around 0
Applied rewrites67.7%
(FPCore (alpha beta i) :precision binary64 (if (<= beta 1.08e+161) 0.0625 (/ (* (/ i beta) i) beta)))
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 1.08e+161) {
tmp = 0.0625;
} else {
tmp = ((i / beta) * i) / beta;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 1.08d+161) then
tmp = 0.0625d0
else
tmp = ((i / beta) * i) / beta
end if
code = tmp
end function
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 1.08e+161) {
tmp = 0.0625;
} else {
tmp = ((i / beta) * i) / beta;
}
return tmp;
}
def code(alpha, beta, i): tmp = 0 if beta <= 1.08e+161: tmp = 0.0625 else: tmp = ((i / beta) * i) / beta return tmp
function code(alpha, beta, i) tmp = 0.0 if (beta <= 1.08e+161) tmp = 0.0625; else tmp = Float64(Float64(Float64(i / beta) * i) / beta); end return tmp end
function tmp_2 = code(alpha, beta, i) tmp = 0.0; if (beta <= 1.08e+161) tmp = 0.0625; else tmp = ((i / beta) * i) / beta; end tmp_2 = tmp; end
code[alpha_, beta_, i_] := If[LessEqual[beta, 1.08e+161], 0.0625, N[(N[(N[(i / beta), $MachinePrecision] * i), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.08 \cdot 10^{+161}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{\beta} \cdot i}{\beta}\\
\end{array}
\end{array}
if beta < 1.08e161Initial program 16.6%
Taylor expanded in i around inf
Applied rewrites82.7%
if 1.08e161 < beta Initial program 0.0%
Taylor expanded in beta around inf
*-commutativeN/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
Taylor expanded in alpha around 0
Applied rewrites25.3%
Applied rewrites67.6%
(FPCore (alpha beta i) :precision binary64 (if (<= beta 1.08e+161) 0.0625 (* (/ (/ i beta) beta) i)))
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 1.08e+161) {
tmp = 0.0625;
} else {
tmp = ((i / beta) / beta) * i;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 1.08d+161) then
tmp = 0.0625d0
else
tmp = ((i / beta) / beta) * i
end if
code = tmp
end function
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 1.08e+161) {
tmp = 0.0625;
} else {
tmp = ((i / beta) / beta) * i;
}
return tmp;
}
def code(alpha, beta, i): tmp = 0 if beta <= 1.08e+161: tmp = 0.0625 else: tmp = ((i / beta) / beta) * i return tmp
function code(alpha, beta, i) tmp = 0.0 if (beta <= 1.08e+161) tmp = 0.0625; else tmp = Float64(Float64(Float64(i / beta) / beta) * i); end return tmp end
function tmp_2 = code(alpha, beta, i) tmp = 0.0; if (beta <= 1.08e+161) tmp = 0.0625; else tmp = ((i / beta) / beta) * i; end tmp_2 = tmp; end
code[alpha_, beta_, i_] := If[LessEqual[beta, 1.08e+161], 0.0625, N[(N[(N[(i / beta), $MachinePrecision] / beta), $MachinePrecision] * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.08 \cdot 10^{+161}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{\beta}}{\beta} \cdot i\\
\end{array}
\end{array}
if beta < 1.08e161Initial program 16.6%
Taylor expanded in i around inf
Applied rewrites82.7%
if 1.08e161 < beta Initial program 0.0%
Taylor expanded in beta around inf
*-commutativeN/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
Taylor expanded in alpha around 0
Applied rewrites25.3%
Applied rewrites53.8%
(FPCore (alpha beta i) :precision binary64 (if (<= beta 2.15e+220) 0.0625 (* alpha (/ i (* beta beta)))))
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2.15e+220) {
tmp = 0.0625;
} else {
tmp = alpha * (i / (beta * beta));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 2.15d+220) then
tmp = 0.0625d0
else
tmp = alpha * (i / (beta * beta))
end if
code = tmp
end function
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2.15e+220) {
tmp = 0.0625;
} else {
tmp = alpha * (i / (beta * beta));
}
return tmp;
}
def code(alpha, beta, i): tmp = 0 if beta <= 2.15e+220: tmp = 0.0625 else: tmp = alpha * (i / (beta * beta)) return tmp
function code(alpha, beta, i) tmp = 0.0 if (beta <= 2.15e+220) tmp = 0.0625; else tmp = Float64(alpha * Float64(i / Float64(beta * beta))); end return tmp end
function tmp_2 = code(alpha, beta, i) tmp = 0.0; if (beta <= 2.15e+220) tmp = 0.0625; else tmp = alpha * (i / (beta * beta)); end tmp_2 = tmp; end
code[alpha_, beta_, i_] := If[LessEqual[beta, 2.15e+220], 0.0625, N[(alpha * N[(i / N[(beta * beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.15 \cdot 10^{+220}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\alpha \cdot \frac{i}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.15e220Initial program 15.0%
Taylor expanded in i around inf
Applied rewrites78.1%
if 2.15e220 < beta Initial program 0.0%
Taylor expanded in beta around inf
*-commutativeN/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6482.3
Applied rewrites82.3%
Taylor expanded in alpha around inf
Applied rewrites36.0%
(FPCore (alpha beta i) :precision binary64 0.0625)
double code(double alpha, double beta, double i) {
return 0.0625;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(alpha, beta, i)
use fmin_fmax_functions
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
code = 0.0625d0
end function
public static double code(double alpha, double beta, double i) {
return 0.0625;
}
def code(alpha, beta, i): return 0.0625
function code(alpha, beta, i) return 0.0625 end
function tmp = code(alpha, beta, i) tmp = 0.0625; end
code[alpha_, beta_, i_] := 0.0625
\begin{array}{l}
\\
0.0625
\end{array}
Initial program 13.3%
Taylor expanded in i around inf
Applied rewrites71.6%
herbie shell --seed 2024350
(FPCore (alpha beta i)
:name "Octave 3.8, jcobi/4"
:precision binary64
:pre (and (and (> alpha -1.0) (> beta -1.0)) (> i 1.0))
(/ (/ (* (* i (+ (+ alpha beta) i)) (+ (* beta alpha) (* i (+ (+ alpha beta) i)))) (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i)))) (- (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i))) 1.0)))