
(FPCore (s u) :precision binary32 (* s (log (/ 1.0 (- 1.0 (* 4.0 u))))))
float code(float s, float u) {
return s * logf((1.0f / (1.0f - (4.0f * u))));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * log((1.0e0 / (1.0e0 - (4.0e0 * u))))
end function
function code(s, u) return Float32(s * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(4.0) * u))))) end
function tmp = code(s, u) tmp = s * log((single(1.0) / (single(1.0) - (single(4.0) * u)))); end
s \cdot \log \left(\frac{1}{1 - 4 \cdot u}\right)
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (s u) :precision binary32 (* s (log (/ 1.0 (- 1.0 (* 4.0 u))))))
float code(float s, float u) {
return s * logf((1.0f / (1.0f - (4.0f * u))));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * log((1.0e0 / (1.0e0 - (4.0e0 * u))))
end function
function code(s, u) return Float32(s * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(4.0) * u))))) end
function tmp = code(s, u) tmp = s * log((single(1.0) / (single(1.0) - (single(4.0) * u)))); end
s \cdot \log \left(\frac{1}{1 - 4 \cdot u}\right)
(FPCore (s u)
:precision binary32
(let* ((t_0 (- (log (- (* -8.0 u) -2.0)))))
(if (<= (- 1.0 (* 4.0 u)) 0.9599999785423279)
(* s (* (+ 1.0 (/ (log 2.0) t_0)) t_0))
(*
s
(+
(* (* (- (* (- (* 64.0 u) -21.333333333333332) u) -8.0) u) u)
(* u 4.0))))))float code(float s, float u) {
float t_0 = -logf(((-8.0f * u) - -2.0f));
float tmp;
if ((1.0f - (4.0f * u)) <= 0.9599999785423279f) {
tmp = s * ((1.0f + (logf(2.0f) / t_0)) * t_0);
} else {
tmp = s * (((((((64.0f * u) - -21.333333333333332f) * u) - -8.0f) * u) * u) + (u * 4.0f));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
real(4) :: t_0
real(4) :: tmp
t_0 = -log((((-8.0e0) * u) - (-2.0e0)))
if ((1.0e0 - (4.0e0 * u)) <= 0.9599999785423279e0) then
tmp = s * ((1.0e0 + (log(2.0e0) / t_0)) * t_0)
else
tmp = s * (((((((64.0e0 * u) - (-21.333333333333332e0)) * u) - (-8.0e0)) * u) * u) + (u * 4.0e0))
end if
code = tmp
end function
function code(s, u) t_0 = Float32(-log(Float32(Float32(Float32(-8.0) * u) - Float32(-2.0)))) tmp = Float32(0.0) if (Float32(Float32(1.0) - Float32(Float32(4.0) * u)) <= Float32(0.9599999785423279)) tmp = Float32(s * Float32(Float32(Float32(1.0) + Float32(log(Float32(2.0)) / t_0)) * t_0)); else tmp = Float32(s * Float32(Float32(Float32(Float32(Float32(Float32(Float32(Float32(64.0) * u) - Float32(-21.333333333333332)) * u) - Float32(-8.0)) * u) * u) + Float32(u * Float32(4.0)))); end return tmp end
function tmp_2 = code(s, u) t_0 = -log(((single(-8.0) * u) - single(-2.0))); tmp = single(0.0); if ((single(1.0) - (single(4.0) * u)) <= single(0.9599999785423279)) tmp = s * ((single(1.0) + (log(single(2.0)) / t_0)) * t_0); else tmp = s * (((((((single(64.0) * u) - single(-21.333333333333332)) * u) - single(-8.0)) * u) * u) + (u * single(4.0))); end tmp_2 = tmp; end
\begin{array}{l}
t_0 := -\log \left(-8 \cdot u - -2\right)\\
\mathbf{if}\;1 - 4 \cdot u \leq 0.9599999785423279:\\
\;\;\;\;s \cdot \left(\left(1 + \frac{\log 2}{t\_0}\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;s \cdot \left(\left(\left(\left(64 \cdot u - -21.333333333333332\right) \cdot u - -8\right) \cdot u\right) \cdot u + u \cdot 4\right)\\
\end{array}
if (-.f32 #s(literal 1 binary32) (*.f32 #s(literal 4 binary32) u)) < 0.959999979Initial program 61.3%
Applied rewrites63.4%
lift--.f32N/A
sub-flipN/A
+-commutativeN/A
sum-to-multN/A
lower-unsound-*.f32N/A
lower-unsound-+.f32N/A
lower-unsound-/.f32N/A
lower-neg.f32N/A
lift-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-neg.f3262.2%
lift-*.f32N/A
*-commutativeN/A
lower-*.f3262.2%
Applied rewrites62.2%
if 0.959999979 < (-.f32 #s(literal 1 binary32) (*.f32 #s(literal 4 binary32) u)) Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
lift-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lift-*.f32N/A
lower-+.f32N/A
Applied rewrites93.1%
(FPCore (s u)
:precision binary32
(if (<= (- 1.0 (* 4.0 u)) 0.9599999785423279)
(+ (* 0.6931471824645996 s) (* (- (log (- (* -8.0 u) -2.0))) s))
(*
s
(+
(* (* (- (* (- (* 64.0 u) -21.333333333333332) u) -8.0) u) u)
(* u 4.0)))))float code(float s, float u) {
float tmp;
if ((1.0f - (4.0f * u)) <= 0.9599999785423279f) {
tmp = (0.6931471824645996f * s) + (-logf(((-8.0f * u) - -2.0f)) * s);
} else {
tmp = s * (((((((64.0f * u) - -21.333333333333332f) * u) - -8.0f) * u) * u) + (u * 4.0f));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
real(4) :: tmp
if ((1.0e0 - (4.0e0 * u)) <= 0.9599999785423279e0) then
tmp = (0.6931471824645996e0 * s) + (-log((((-8.0e0) * u) - (-2.0e0))) * s)
else
tmp = s * (((((((64.0e0 * u) - (-21.333333333333332e0)) * u) - (-8.0e0)) * u) * u) + (u * 4.0e0))
end if
code = tmp
end function
function code(s, u) tmp = Float32(0.0) if (Float32(Float32(1.0) - Float32(Float32(4.0) * u)) <= Float32(0.9599999785423279)) tmp = Float32(Float32(Float32(0.6931471824645996) * s) + Float32(Float32(-log(Float32(Float32(Float32(-8.0) * u) - Float32(-2.0)))) * s)); else tmp = Float32(s * Float32(Float32(Float32(Float32(Float32(Float32(Float32(Float32(64.0) * u) - Float32(-21.333333333333332)) * u) - Float32(-8.0)) * u) * u) + Float32(u * Float32(4.0)))); end return tmp end
function tmp_2 = code(s, u) tmp = single(0.0); if ((single(1.0) - (single(4.0) * u)) <= single(0.9599999785423279)) tmp = (single(0.6931471824645996) * s) + (-log(((single(-8.0) * u) - single(-2.0))) * s); else tmp = s * (((((((single(64.0) * u) - single(-21.333333333333332)) * u) - single(-8.0)) * u) * u) + (u * single(4.0))); end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;1 - 4 \cdot u \leq 0.9599999785423279:\\
\;\;\;\;0.6931471824645996 \cdot s + \left(-\log \left(-8 \cdot u - -2\right)\right) \cdot s\\
\mathbf{else}:\\
\;\;\;\;s \cdot \left(\left(\left(\left(64 \cdot u - -21.333333333333332\right) \cdot u - -8\right) \cdot u\right) \cdot u + u \cdot 4\right)\\
\end{array}
if (-.f32 #s(literal 1 binary32) (*.f32 #s(literal 4 binary32) u)) < 0.959999979Initial program 61.3%
Applied rewrites63.4%
lift-*.f32N/A
lift--.f32N/A
sub-flipN/A
distribute-rgt-inN/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-neg.f3262.2%
lift-*.f32N/A
*-commutativeN/A
lower-*.f3262.2%
Applied rewrites62.2%
Evaluated real constant62.2%
if 0.959999979 < (-.f32 #s(literal 1 binary32) (*.f32 #s(literal 4 binary32) u)) Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
lift-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lift-*.f32N/A
lower-+.f32N/A
Applied rewrites93.1%
(FPCore (s u)
:precision binary32
(if (<= u 0.009499999694526196)
(*
s
(+
(* (* (- (* (- (* 64.0 u) -21.333333333333332) u) -8.0) u) u)
(* u 4.0)))
(* s (- 0.6931471824645996 (log (- (* u -8.0) -2.0))))))float code(float s, float u) {
float tmp;
if (u <= 0.009499999694526196f) {
tmp = s * (((((((64.0f * u) - -21.333333333333332f) * u) - -8.0f) * u) * u) + (u * 4.0f));
} else {
tmp = s * (0.6931471824645996f - logf(((u * -8.0f) - -2.0f)));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
real(4) :: tmp
if (u <= 0.009499999694526196e0) then
tmp = s * (((((((64.0e0 * u) - (-21.333333333333332e0)) * u) - (-8.0e0)) * u) * u) + (u * 4.0e0))
else
tmp = s * (0.6931471824645996e0 - log(((u * (-8.0e0)) - (-2.0e0))))
end if
code = tmp
end function
function code(s, u) tmp = Float32(0.0) if (u <= Float32(0.009499999694526196)) tmp = Float32(s * Float32(Float32(Float32(Float32(Float32(Float32(Float32(Float32(64.0) * u) - Float32(-21.333333333333332)) * u) - Float32(-8.0)) * u) * u) + Float32(u * Float32(4.0)))); else tmp = Float32(s * Float32(Float32(0.6931471824645996) - log(Float32(Float32(u * Float32(-8.0)) - Float32(-2.0))))); end return tmp end
function tmp_2 = code(s, u) tmp = single(0.0); if (u <= single(0.009499999694526196)) tmp = s * (((((((single(64.0) * u) - single(-21.333333333333332)) * u) - single(-8.0)) * u) * u) + (u * single(4.0))); else tmp = s * (single(0.6931471824645996) - log(((u * single(-8.0)) - single(-2.0)))); end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;u \leq 0.009499999694526196:\\
\;\;\;\;s \cdot \left(\left(\left(\left(64 \cdot u - -21.333333333333332\right) \cdot u - -8\right) \cdot u\right) \cdot u + u \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;s \cdot \left(0.6931471824645996 - \log \left(u \cdot -8 - -2\right)\right)\\
\end{array}
if u < 0.00949999969Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
lift-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lift-*.f32N/A
lower-+.f32N/A
Applied rewrites93.1%
if 0.00949999969 < u Initial program 61.3%
Applied rewrites63.4%
Evaluated real constant63.4%
(FPCore (s u)
:precision binary32
(if (<= u 0.010400000028312206)
(*
s
(+
(* (* (- (* (- (* 64.0 u) -21.333333333333332) u) -8.0) u) u)
(* u 4.0)))
(* (- (log (- 1.0 (* u 4.0)))) s)))float code(float s, float u) {
float tmp;
if (u <= 0.010400000028312206f) {
tmp = s * (((((((64.0f * u) - -21.333333333333332f) * u) - -8.0f) * u) * u) + (u * 4.0f));
} else {
tmp = -logf((1.0f - (u * 4.0f))) * s;
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
real(4) :: tmp
if (u <= 0.010400000028312206e0) then
tmp = s * (((((((64.0e0 * u) - (-21.333333333333332e0)) * u) - (-8.0e0)) * u) * u) + (u * 4.0e0))
else
tmp = -log((1.0e0 - (u * 4.0e0))) * s
end if
code = tmp
end function
function code(s, u) tmp = Float32(0.0) if (u <= Float32(0.010400000028312206)) tmp = Float32(s * Float32(Float32(Float32(Float32(Float32(Float32(Float32(Float32(64.0) * u) - Float32(-21.333333333333332)) * u) - Float32(-8.0)) * u) * u) + Float32(u * Float32(4.0)))); else tmp = Float32(Float32(-log(Float32(Float32(1.0) - Float32(u * Float32(4.0))))) * s); end return tmp end
function tmp_2 = code(s, u) tmp = single(0.0); if (u <= single(0.010400000028312206)) tmp = s * (((((((single(64.0) * u) - single(-21.333333333333332)) * u) - single(-8.0)) * u) * u) + (u * single(4.0))); else tmp = -log((single(1.0) - (u * single(4.0)))) * s; end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;u \leq 0.010400000028312206:\\
\;\;\;\;s \cdot \left(\left(\left(\left(64 \cdot u - -21.333333333333332\right) \cdot u - -8\right) \cdot u\right) \cdot u + u \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\log \left(1 - u \cdot 4\right)\right) \cdot s\\
\end{array}
if u < 0.0104Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
lift-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lift-*.f32N/A
lower-+.f32N/A
Applied rewrites93.1%
if 0.0104 < u Initial program 61.3%
lift-*.f32N/A
*-commutativeN/A
lower-*.f3261.3%
lift-log.f32N/A
lift-/.f32N/A
log-recN/A
lower-log.f64N/A
lower-unsound-log.f64N/A
lower-neg.f32N/A
lower-unsound-log.f3263.8%
lift-*.f32N/A
*-commutativeN/A
lower-*.f3263.8%
Applied rewrites63.8%
(FPCore (s u)
:precision binary32
(*
u
(*
(-
1.0
(/
(-
(*
u
(+
1.3333333333333333
(* u (+ 0.4444444444444444 (* -11.851851851851851 u)))))
0.5)
u))
(*
(- (* (- (* (* u s) 64.0) (* -21.333333333333332 s)) u) (* -8.0 s))
u))))float code(float s, float u) {
return u * ((1.0f - (((u * (1.3333333333333333f + (u * (0.4444444444444444f + (-11.851851851851851f * u))))) - 0.5f) / u)) * ((((((u * s) * 64.0f) - (-21.333333333333332f * s)) * u) - (-8.0f * s)) * u));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = u * ((1.0e0 - (((u * (1.3333333333333333e0 + (u * (0.4444444444444444e0 + ((-11.851851851851851e0) * u))))) - 0.5e0) / u)) * ((((((u * s) * 64.0e0) - ((-21.333333333333332e0) * s)) * u) - ((-8.0e0) * s)) * u))
end function
function code(s, u) return Float32(u * Float32(Float32(Float32(1.0) - Float32(Float32(Float32(u * Float32(Float32(1.3333333333333333) + Float32(u * Float32(Float32(0.4444444444444444) + Float32(Float32(-11.851851851851851) * u))))) - Float32(0.5)) / u)) * Float32(Float32(Float32(Float32(Float32(Float32(u * s) * Float32(64.0)) - Float32(Float32(-21.333333333333332) * s)) * u) - Float32(Float32(-8.0) * s)) * u))) end
function tmp = code(s, u) tmp = u * ((single(1.0) - (((u * (single(1.3333333333333333) + (u * (single(0.4444444444444444) + (single(-11.851851851851851) * u))))) - single(0.5)) / u)) * ((((((u * s) * single(64.0)) - (single(-21.333333333333332) * s)) * u) - (single(-8.0) * s)) * u)); end
u \cdot \left(\left(1 - \frac{u \cdot \left(1.3333333333333333 + u \cdot \left(0.4444444444444444 + -11.851851851851851 \cdot u\right)\right) - 0.5}{u}\right) \cdot \left(\left(\left(\left(u \cdot s\right) \cdot 64 - -21.333333333333332 \cdot s\right) \cdot u - -8 \cdot s\right) \cdot u\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3293.1%
Applied rewrites93.1%
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
fp-cancel-sign-sub-invN/A
sub-to-multN/A
lower-unsound-*.f32N/A
Applied rewrites92.4%
Taylor expanded in u around 0
lower-/.f32N/A
lower--.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3294.4%
Applied rewrites94.4%
(FPCore (s u)
:precision binary32
(*
u
(*
(/
(+
0.5
(*
u
(-
(* u (- (* 11.851851851851851 u) 0.4444444444444444))
0.3333333333333333)))
u)
(*
(- (* (- (* (* u s) 64.0) (* -21.333333333333332 s)) u) (* -8.0 s))
u))))float code(float s, float u) {
return u * (((0.5f + (u * ((u * ((11.851851851851851f * u) - 0.4444444444444444f)) - 0.3333333333333333f))) / u) * ((((((u * s) * 64.0f) - (-21.333333333333332f * s)) * u) - (-8.0f * s)) * u));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = u * (((0.5e0 + (u * ((u * ((11.851851851851851e0 * u) - 0.4444444444444444e0)) - 0.3333333333333333e0))) / u) * ((((((u * s) * 64.0e0) - ((-21.333333333333332e0) * s)) * u) - ((-8.0e0) * s)) * u))
end function
function code(s, u) return Float32(u * Float32(Float32(Float32(Float32(0.5) + Float32(u * Float32(Float32(u * Float32(Float32(Float32(11.851851851851851) * u) - Float32(0.4444444444444444))) - Float32(0.3333333333333333)))) / u) * Float32(Float32(Float32(Float32(Float32(Float32(u * s) * Float32(64.0)) - Float32(Float32(-21.333333333333332) * s)) * u) - Float32(Float32(-8.0) * s)) * u))) end
function tmp = code(s, u) tmp = u * (((single(0.5) + (u * ((u * ((single(11.851851851851851) * u) - single(0.4444444444444444))) - single(0.3333333333333333)))) / u) * ((((((u * s) * single(64.0)) - (single(-21.333333333333332) * s)) * u) - (single(-8.0) * s)) * u)); end
u \cdot \left(\frac{0.5 + u \cdot \left(u \cdot \left(11.851851851851851 \cdot u - 0.4444444444444444\right) - 0.3333333333333333\right)}{u} \cdot \left(\left(\left(\left(u \cdot s\right) \cdot 64 - -21.333333333333332 \cdot s\right) \cdot u - -8 \cdot s\right) \cdot u\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3293.1%
Applied rewrites93.1%
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
fp-cancel-sign-sub-invN/A
sub-to-multN/A
lower-unsound-*.f32N/A
Applied rewrites92.4%
Taylor expanded in u around 0
lower-/.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower--.f32N/A
lower-*.f32N/A
lower--.f32N/A
lower-*.f3294.4%
Applied rewrites94.4%
(FPCore (s u) :precision binary32 (* s (+ (* (* (- (* (- (* 64.0 u) -21.333333333333332) u) -8.0) u) u) (* u 4.0))))
float code(float s, float u) {
return s * (((((((64.0f * u) - -21.333333333333332f) * u) - -8.0f) * u) * u) + (u * 4.0f));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * (((((((64.0e0 * u) - (-21.333333333333332e0)) * u) - (-8.0e0)) * u) * u) + (u * 4.0e0))
end function
function code(s, u) return Float32(s * Float32(Float32(Float32(Float32(Float32(Float32(Float32(Float32(64.0) * u) - Float32(-21.333333333333332)) * u) - Float32(-8.0)) * u) * u) + Float32(u * Float32(4.0)))) end
function tmp = code(s, u) tmp = s * (((((((single(64.0) * u) - single(-21.333333333333332)) * u) - single(-8.0)) * u) * u) + (u * single(4.0))); end
s \cdot \left(\left(\left(\left(64 \cdot u - -21.333333333333332\right) \cdot u - -8\right) \cdot u\right) \cdot u + u \cdot 4\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
lift-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lift-*.f32N/A
lower-+.f32N/A
Applied rewrites93.1%
(FPCore (s u) :precision binary32 (* u (+ (* 4.0 s) (* s (* u (+ 8.0 (* u (+ 21.333333333333332 (* 64.0 u)))))))))
float code(float s, float u) {
return u * ((4.0f * s) + (s * (u * (8.0f + (u * (21.333333333333332f + (64.0f * u)))))));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = u * ((4.0e0 * s) + (s * (u * (8.0e0 + (u * (21.333333333333332e0 + (64.0e0 * u)))))))
end function
function code(s, u) return Float32(u * Float32(Float32(Float32(4.0) * s) + Float32(s * Float32(u * Float32(Float32(8.0) + Float32(u * Float32(Float32(21.333333333333332) + Float32(Float32(64.0) * u)))))))) end
function tmp = code(s, u) tmp = u * ((single(4.0) * s) + (s * (u * (single(8.0) + (u * (single(21.333333333333332) + (single(64.0) * u))))))); end
u \cdot \left(4 \cdot s + s \cdot \left(u \cdot \left(8 + u \cdot \left(21.333333333333332 + 64 \cdot u\right)\right)\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3293.1%
Applied rewrites93.1%
Taylor expanded in s around 0
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3293.1%
Applied rewrites93.1%
(FPCore (s u) :precision binary32 (* s (* u (+ 4.0 (* u (+ 8.0 (* u (+ 21.333333333333332 (* 64.0 u)))))))))
float code(float s, float u) {
return s * (u * (4.0f + (u * (8.0f + (u * (21.333333333333332f + (64.0f * u)))))));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * (u * (4.0e0 + (u * (8.0e0 + (u * (21.333333333333332e0 + (64.0e0 * u)))))))
end function
function code(s, u) return Float32(s * Float32(u * Float32(Float32(4.0) + Float32(u * Float32(Float32(8.0) + Float32(u * Float32(Float32(21.333333333333332) + Float32(Float32(64.0) * u)))))))) end
function tmp = code(s, u) tmp = s * (u * (single(4.0) + (u * (single(8.0) + (u * (single(21.333333333333332) + (single(64.0) * u))))))); end
s \cdot \left(u \cdot \left(4 + u \cdot \left(8 + u \cdot \left(21.333333333333332 + 64 \cdot u\right)\right)\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
(FPCore (s u) :precision binary32 (* u (* s (+ 4.0 (* u (+ 8.0 (* u (+ 21.333333333333332 (* 64.0 u)))))))))
float code(float s, float u) {
return u * (s * (4.0f + (u * (8.0f + (u * (21.333333333333332f + (64.0f * u)))))));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = u * (s * (4.0e0 + (u * (8.0e0 + (u * (21.333333333333332e0 + (64.0e0 * u)))))))
end function
function code(s, u) return Float32(u * Float32(s * Float32(Float32(4.0) + Float32(u * Float32(Float32(8.0) + Float32(u * Float32(Float32(21.333333333333332) + Float32(Float32(64.0) * u)))))))) end
function tmp = code(s, u) tmp = u * (s * (single(4.0) + (u * (single(8.0) + (u * (single(21.333333333333332) + (single(64.0) * u))))))); end
u \cdot \left(s \cdot \left(4 + u \cdot \left(8 + u \cdot \left(21.333333333333332 + 64 \cdot u\right)\right)\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3293.1%
Applied rewrites93.1%
Taylor expanded in s around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
(FPCore (s u) :precision binary32 (* s (+ (* (* (- (* 21.333333333333332 u) -8.0) u) u) (* u 4.0))))
float code(float s, float u) {
return s * (((((21.333333333333332f * u) - -8.0f) * u) * u) + (u * 4.0f));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * (((((21.333333333333332e0 * u) - (-8.0e0)) * u) * u) + (u * 4.0e0))
end function
function code(s, u) return Float32(s * Float32(Float32(Float32(Float32(Float32(Float32(21.333333333333332) * u) - Float32(-8.0)) * u) * u) + Float32(u * Float32(4.0)))) end
function tmp = code(s, u) tmp = s * (((((single(21.333333333333332) * u) - single(-8.0)) * u) * u) + (u * single(4.0))); end
s \cdot \left(\left(\left(21.333333333333332 \cdot u - -8\right) \cdot u\right) \cdot u + u \cdot 4\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
lift-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lift-*.f32N/A
lower-+.f32N/A
Applied rewrites93.1%
Taylor expanded in u around 0
Applied rewrites90.9%
(FPCore (s u) :precision binary32 (* u (+ (* 4.0 s) (* s (* u (+ 8.0 (* u 21.333333333333332)))))))
float code(float s, float u) {
return u * ((4.0f * s) + (s * (u * (8.0f + (u * 21.333333333333332f)))));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = u * ((4.0e0 * s) + (s * (u * (8.0e0 + (u * 21.333333333333332e0)))))
end function
function code(s, u) return Float32(u * Float32(Float32(Float32(4.0) * s) + Float32(s * Float32(u * Float32(Float32(8.0) + Float32(u * Float32(21.333333333333332))))))) end
function tmp = code(s, u) tmp = u * ((single(4.0) * s) + (s * (u * (single(8.0) + (u * single(21.333333333333332)))))); end
u \cdot \left(4 \cdot s + s \cdot \left(u \cdot \left(8 + u \cdot 21.333333333333332\right)\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3293.1%
Applied rewrites93.1%
Taylor expanded in s around 0
lower-*.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3293.1%
Applied rewrites93.1%
Taylor expanded in u around 0
Applied rewrites90.9%
(FPCore (s u) :precision binary32 (* s (* u (+ 4.0 (* u (+ 8.0 (* 21.333333333333332 u)))))))
float code(float s, float u) {
return s * (u * (4.0f + (u * (8.0f + (21.333333333333332f * u)))));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * (u * (4.0e0 + (u * (8.0e0 + (21.333333333333332e0 * u)))))
end function
function code(s, u) return Float32(s * Float32(u * Float32(Float32(4.0) + Float32(u * Float32(Float32(8.0) + Float32(Float32(21.333333333333332) * u)))))) end
function tmp = code(s, u) tmp = s * (u * (single(4.0) + (u * (single(8.0) + (single(21.333333333333332) * u))))); end
s \cdot \left(u \cdot \left(4 + u \cdot \left(8 + 21.333333333333332 \cdot u\right)\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3290.7%
Applied rewrites90.7%
(FPCore (s u) :precision binary32 (* s (+ (* (* 8.0 u) u) (* u 4.0))))
float code(float s, float u) {
return s * (((8.0f * u) * u) + (u * 4.0f));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * (((8.0e0 * u) * u) + (u * 4.0e0))
end function
function code(s, u) return Float32(s * Float32(Float32(Float32(Float32(8.0) * u) * u) + Float32(u * Float32(4.0)))) end
function tmp = code(s, u) tmp = s * (((single(8.0) * u) * u) + (u * single(4.0))); end
s \cdot \left(\left(8 \cdot u\right) \cdot u + u \cdot 4\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
lift-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lift-*.f32N/A
lower-+.f32N/A
Applied rewrites93.1%
Taylor expanded in u around 0
Applied rewrites86.5%
(FPCore (s u) :precision binary32 (* u (+ (* 4.0 s) (* 8.0 (* s u)))))
float code(float s, float u) {
return u * ((4.0f * s) + (8.0f * (s * u)));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = u * ((4.0e0 * s) + (8.0e0 * (s * u)))
end function
function code(s, u) return Float32(u * Float32(Float32(Float32(4.0) * s) + Float32(Float32(8.0) * Float32(s * u)))) end
function tmp = code(s, u) tmp = u * ((single(4.0) * s) + (single(8.0) * (s * u))); end
u \cdot \left(4 \cdot s + 8 \cdot \left(s \cdot u\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3286.5%
Applied rewrites86.5%
(FPCore (s u) :precision binary32 (* s (* u (+ 4.0 (* 8.0 u)))))
float code(float s, float u) {
return s * (u * (4.0f + (8.0f * u)));
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * (u * (4.0e0 + (8.0e0 * u)))
end function
function code(s, u) return Float32(s * Float32(u * Float32(Float32(4.0) + Float32(Float32(8.0) * u)))) end
function tmp = code(s, u) tmp = s * (u * (single(4.0) + (single(8.0) * u))); end
s \cdot \left(u \cdot \left(4 + 8 \cdot u\right)\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3286.3%
Applied rewrites86.3%
(FPCore (s u) :precision binary32 (* s (* u 4.0)))
float code(float s, float u) {
return s * (u * 4.0f);
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = s * (u * 4.0e0)
end function
function code(s, u) return Float32(s * Float32(u * Float32(4.0))) end
function tmp = code(s, u) tmp = s * (u * single(4.0)); end
s \cdot \left(u \cdot 4\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f32N/A
lower-+.f32N/A
lower-*.f3292.8%
Applied rewrites92.8%
Taylor expanded in u around 0
Applied rewrites73.6%
(FPCore (s u) :precision binary32 (* 4.0 (* s u)))
float code(float s, float u) {
return 4.0f * (s * u);
}
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(4) function code(s, u)
use fmin_fmax_functions
real(4), intent (in) :: s
real(4), intent (in) :: u
code = 4.0e0 * (s * u)
end function
function code(s, u) return Float32(Float32(4.0) * Float32(s * u)) end
function tmp = code(s, u) tmp = single(4.0) * (s * u); end
4 \cdot \left(s \cdot u\right)
Initial program 61.3%
Taylor expanded in u around 0
lower-*.f32N/A
lower-*.f3273.4%
Applied rewrites73.4%
herbie shell --seed 2025258
(FPCore (s u)
:name "Disney BSSRDF, sample scattering profile, lower"
:precision binary32
:pre (and (and (<= 0.0 s) (<= s 256.0)) (and (<= 2.328306437e-10 u) (<= u 0.25)))
(* s (log (/ 1.0 (- 1.0 (* 4.0 u))))))