
(FPCore (s u) :precision binary32 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
float code(float s, float u) {
return (3.0f * s) * logf((1.0f / (1.0f - ((u - 0.25f) / 0.75f))));
}
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 = (3.0e0 * s) * log((1.0e0 / (1.0e0 - ((u - 0.25e0) / 0.75e0))))
end function
function code(s, u) return Float32(Float32(Float32(3.0) * s) * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(u - Float32(0.25)) / Float32(0.75)))))) end
function tmp = code(s, u) tmp = (single(3.0) * s) * log((single(1.0) / (single(1.0) - ((u - single(0.25)) / single(0.75))))); end
\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (s u) :precision binary32 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
float code(float s, float u) {
return (3.0f * s) * logf((1.0f / (1.0f - ((u - 0.25f) / 0.75f))));
}
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 = (3.0e0 * s) * log((1.0e0 / (1.0e0 - ((u - 0.25e0) / 0.75e0))))
end function
function code(s, u) return Float32(Float32(Float32(3.0) * s) * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(u - Float32(0.25)) / Float32(0.75)))))) end
function tmp = code(s, u) tmp = (single(3.0) * s) * log((single(1.0) / (single(1.0) - ((u - single(0.25)) / single(0.75))))); end
\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)
(FPCore (s u) :precision binary32 (* (+ 1.0 (/ (* (* (- (log (- 1.0 u))) s) 3.0) (* -0.8630462288856506 s))) (* -0.8630462288856506 s)))
float code(float s, float u) {
return (1.0f + (((-logf((1.0f - u)) * s) * 3.0f) / (-0.8630462288856506f * s))) * (-0.8630462288856506f * s);
}
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 = (1.0e0 + (((-log((1.0e0 - u)) * s) * 3.0e0) / ((-0.8630462288856506e0) * s))) * ((-0.8630462288856506e0) * s)
end function
function code(s, u) return Float32(Float32(Float32(1.0) + Float32(Float32(Float32(Float32(-log(Float32(Float32(1.0) - u))) * s) * Float32(3.0)) / Float32(Float32(-0.8630462288856506) * s))) * Float32(Float32(-0.8630462288856506) * s)) end
function tmp = code(s, u) tmp = (single(1.0) + (((-log((single(1.0) - u)) * s) * single(3.0)) / (single(-0.8630462288856506) * s))) * (single(-0.8630462288856506) * s); end
\left(1 + \frac{\left(\left(-\log \left(1 - u\right)\right) \cdot s\right) \cdot 3}{-0.8630462288856506 \cdot s}\right) \cdot \left(-0.8630462288856506 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
(FPCore (s u) :precision binary32 (+ (* -0.8630462288856506 s) (* -3.0 (* s (log (- 1.0 u))))))
float code(float s, float u) {
return (-0.8630462288856506f * s) + (-3.0f * (s * logf((1.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 = ((-0.8630462288856506e0) * s) + ((-3.0e0) * (s * log((1.0e0 - u))))
end function
function code(s, u) return Float32(Float32(Float32(-0.8630462288856506) * s) + Float32(Float32(-3.0) * Float32(s * log(Float32(Float32(1.0) - u))))) end
function tmp = code(s, u) tmp = (single(-0.8630462288856506) * s) + (single(-3.0) * (s * log((single(1.0) - u)))); end
-0.8630462288856506 \cdot s + -3 \cdot \left(s \cdot \log \left(1 - u\right)\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
lift-*.f32N/A
lift-+.f32N/A
lift-/.f32N/A
sum-to-mult-revN/A
lower-+.f3296.3%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-neg.f32N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f32N/A
metadata-evalN/A
lower-*.f3296.3%
Applied rewrites96.3%
(FPCore (s u) :precision binary32 (* (+ 1.0 (* 3.476059450342011 (log (- 1.0 u)))) (* -0.8630462288856506 s)))
float code(float s, float u) {
return (1.0f + (3.476059450342011f * logf((1.0f - u)))) * (-0.8630462288856506f * s);
}
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 = (1.0e0 + (3.476059450342011e0 * log((1.0e0 - u)))) * ((-0.8630462288856506e0) * s)
end function
function code(s, u) return Float32(Float32(Float32(1.0) + Float32(Float32(3.476059450342011) * log(Float32(Float32(1.0) - u)))) * Float32(Float32(-0.8630462288856506) * s)) end
function tmp = code(s, u) tmp = (single(1.0) + (single(3.476059450342011) * log((single(1.0) - u)))) * (single(-0.8630462288856506) * s); end
\left(1 + 3.476059450342011 \cdot \log \left(1 - u\right)\right) \cdot \left(-0.8630462288856506 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
Taylor expanded in s around 0
lower-*.f32N/A
lower-log.f32N/A
lower--.f3296.5%
Applied rewrites96.5%
(FPCore (s u) :precision binary32 (* (* (- (log (- (* -1.3333333333333333 u) -1.3333333333333333))) 3.0) s))
float code(float s, float u) {
return (-logf(((-1.3333333333333333f * u) - -1.3333333333333333f)) * 3.0f) * s;
}
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 = (-log((((-1.3333333333333333e0) * u) - (-1.3333333333333333e0))) * 3.0e0) * s
end function
function code(s, u) return Float32(Float32(Float32(-log(Float32(Float32(Float32(-1.3333333333333333) * u) - Float32(-1.3333333333333333)))) * Float32(3.0)) * s) end
function tmp = code(s, u) tmp = (-log(((single(-1.3333333333333333) * u) - single(-1.3333333333333333))) * single(3.0)) * s; end
\left(\left(-\log \left(-1.3333333333333333 \cdot u - -1.3333333333333333\right)\right) \cdot 3\right) \cdot s
Initial program 96.0%
lift--.f32N/A
sub-flipN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f32N/A
lift-/.f32N/A
distribute-neg-frac2N/A
mult-flip-revN/A
*-commutativeN/A
lower-*.f32N/A
metadata-evalN/A
metadata-eval95.8%
Applied rewrites95.8%
lift--.f32N/A
sub-flipN/A
lift-*.f32N/A
lift--.f32N/A
sub-flipN/A
distribute-rgt-inN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
sub-flip-reverseN/A
lower--.f32N/A
*-commutativeN/A
lower-*.f3295.6%
Applied rewrites95.6%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f3295.5%
lift-log.f32N/A
lift-/.f32N/A
log-recN/A
lower-neg.f32N/A
lower-log.f3296.2%
Applied rewrites96.2%
(FPCore (s u) :precision binary32 (* (* 3.0 s) (- -0.28768208622932434 (log (- 1.0 u)))))
float code(float s, float u) {
return (3.0f * s) * (-0.28768208622932434f - logf((1.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 = (3.0e0 * s) * ((-0.28768208622932434e0) - log((1.0e0 - u)))
end function
function code(s, u) return Float32(Float32(Float32(3.0) * s) * Float32(Float32(-0.28768208622932434) - log(Float32(Float32(1.0) - u)))) end
function tmp = code(s, u) tmp = (single(3.0) * s) * (single(-0.28768208622932434) - log((single(1.0) - u))); end
\left(3 \cdot s\right) \cdot \left(-0.28768208622932434 - \log \left(1 - u\right)\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
Evaluated real constant96.5%
(FPCore (s u)
:precision binary32
(*
(+
1.0
(/
(*
u
(+ (* 3.0 s) (* u (+ (* 1.5 s) (* u (+ s (* 0.75 (* s u))))))))
(* -0.8630462288856506 s)))
(* -0.8630462288856506 s)))float code(float s, float u) {
return (1.0f + ((u * ((3.0f * s) + (u * ((1.5f * s) + (u * (s + (0.75f * (s * u)))))))) / (-0.8630462288856506f * s))) * (-0.8630462288856506f * s);
}
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 = (1.0e0 + ((u * ((3.0e0 * s) + (u * ((1.5e0 * s) + (u * (s + (0.75e0 * (s * u)))))))) / ((-0.8630462288856506e0) * s))) * ((-0.8630462288856506e0) * s)
end function
function code(s, u) return Float32(Float32(Float32(1.0) + Float32(Float32(u * Float32(Float32(Float32(3.0) * s) + Float32(u * Float32(Float32(Float32(1.5) * s) + Float32(u * Float32(s + Float32(Float32(0.75) * Float32(s * u)))))))) / Float32(Float32(-0.8630462288856506) * s))) * Float32(Float32(-0.8630462288856506) * s)) end
function tmp = code(s, u) tmp = (single(1.0) + ((u * ((single(3.0) * s) + (u * ((single(1.5) * s) + (u * (s + (single(0.75) * (s * u)))))))) / (single(-0.8630462288856506) * s))) * (single(-0.8630462288856506) * s); end
\left(1 + \frac{u \cdot \left(3 \cdot s + u \cdot \left(1.5 \cdot s + u \cdot \left(s + 0.75 \cdot \left(s \cdot u\right)\right)\right)\right)}{-0.8630462288856506 \cdot s}\right) \cdot \left(-0.8630462288856506 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
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-*.f3240.6%
Applied rewrites40.6%
(FPCore (s u)
:precision binary32
(*
(+
1.0
(/
(*
(*
(*
u
(+ 1.0 (* u (+ 0.5 (* u (+ 0.3333333333333333 (* 0.25 u)))))))
s)
3.0)
(* -0.8630462288856506 s)))
(* -0.8630462288856506 s)))float code(float s, float u) {
return (1.0f + ((((u * (1.0f + (u * (0.5f + (u * (0.3333333333333333f + (0.25f * u))))))) * s) * 3.0f) / (-0.8630462288856506f * s))) * (-0.8630462288856506f * s);
}
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 = (1.0e0 + ((((u * (1.0e0 + (u * (0.5e0 + (u * (0.3333333333333333e0 + (0.25e0 * u))))))) * s) * 3.0e0) / ((-0.8630462288856506e0) * s))) * ((-0.8630462288856506e0) * s)
end function
function code(s, u) return Float32(Float32(Float32(1.0) + Float32(Float32(Float32(Float32(u * Float32(Float32(1.0) + Float32(u * Float32(Float32(0.5) + Float32(u * Float32(Float32(0.3333333333333333) + Float32(Float32(0.25) * u))))))) * s) * Float32(3.0)) / Float32(Float32(-0.8630462288856506) * s))) * Float32(Float32(-0.8630462288856506) * s)) end
function tmp = code(s, u) tmp = (single(1.0) + ((((u * (single(1.0) + (u * (single(0.5) + (u * (single(0.3333333333333333) + (single(0.25) * u))))))) * s) * single(3.0)) / (single(-0.8630462288856506) * s))) * (single(-0.8630462288856506) * s); end
\left(1 + \frac{\left(\left(u \cdot \left(1 + u \cdot \left(0.5 + u \cdot \left(0.3333333333333333 + 0.25 \cdot u\right)\right)\right)\right) \cdot s\right) \cdot 3}{-0.8630462288856506 \cdot s}\right) \cdot \left(-0.8630462288856506 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
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-*.f3240.6%
Applied rewrites40.6%
(FPCore (s u)
:precision binary32
(*
(+
1.0
(*
u
(-
(*
u
(-
(* u (- (* -0.8690148625855028 u) 1.158686483447337))
1.7380297251710055))
3.476059450342011)))
(* -0.8630462288856506 s)))float code(float s, float u) {
return (1.0f + (u * ((u * ((u * ((-0.8690148625855028f * u) - 1.158686483447337f)) - 1.7380297251710055f)) - 3.476059450342011f))) * (-0.8630462288856506f * s);
}
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 = (1.0e0 + (u * ((u * ((u * (((-0.8690148625855028e0) * u) - 1.158686483447337e0)) - 1.7380297251710055e0)) - 3.476059450342011e0))) * ((-0.8630462288856506e0) * s)
end function
function code(s, u) return Float32(Float32(Float32(1.0) + Float32(u * Float32(Float32(u * Float32(Float32(u * Float32(Float32(Float32(-0.8690148625855028) * u) - Float32(1.158686483447337))) - Float32(1.7380297251710055))) - Float32(3.476059450342011)))) * Float32(Float32(-0.8630462288856506) * s)) end
function tmp = code(s, u) tmp = (single(1.0) + (u * ((u * ((u * ((single(-0.8690148625855028) * u) - single(1.158686483447337))) - single(1.7380297251710055))) - single(3.476059450342011)))) * (single(-0.8630462288856506) * s); end
\left(1 + u \cdot \left(u \cdot \left(u \cdot \left(-0.8690148625855028 \cdot u - 1.158686483447337\right) - 1.7380297251710055\right) - 3.476059450342011\right)\right) \cdot \left(-0.8630462288856506 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
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-*.f3240.6%
Applied rewrites40.6%
(FPCore (s u) :precision binary32 (+ (* -0.8630462288856506 s) (* u (+ (* 3.0 s) (* u (+ (* 1.5 s) (* s u)))))))
float code(float s, float u) {
return (-0.8630462288856506f * s) + (u * ((3.0f * s) + (u * ((1.5f * s) + (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 = ((-0.8630462288856506e0) * s) + (u * ((3.0e0 * s) + (u * ((1.5e0 * s) + (s * u)))))
end function
function code(s, u) return Float32(Float32(Float32(-0.8630462288856506) * s) + Float32(u * Float32(Float32(Float32(3.0) * s) + Float32(u * Float32(Float32(Float32(1.5) * s) + Float32(s * u)))))) end
function tmp = code(s, u) tmp = (single(-0.8630462288856506) * s) + (u * ((single(3.0) * s) + (u * ((single(1.5) * s) + (s * u))))); end
-0.8630462288856506 \cdot s + u \cdot \left(3 \cdot s + u \cdot \left(1.5 \cdot s + s \cdot u\right)\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
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-*.f3236.7%
Applied rewrites36.7%
(FPCore (s u)
:precision binary32
(*
(+
1.0
(*
u
(-
(* u (- (* -1.158686483447337 u) 1.7380297251710055))
3.476059450342011)))
(* -0.8630462288856506 s)))float code(float s, float u) {
return (1.0f + (u * ((u * ((-1.158686483447337f * u) - 1.7380297251710055f)) - 3.476059450342011f))) * (-0.8630462288856506f * s);
}
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 = (1.0e0 + (u * ((u * (((-1.158686483447337e0) * u) - 1.7380297251710055e0)) - 3.476059450342011e0))) * ((-0.8630462288856506e0) * s)
end function
function code(s, u) return Float32(Float32(Float32(1.0) + Float32(u * Float32(Float32(u * Float32(Float32(Float32(-1.158686483447337) * u) - Float32(1.7380297251710055))) - Float32(3.476059450342011)))) * Float32(Float32(-0.8630462288856506) * s)) end
function tmp = code(s, u) tmp = (single(1.0) + (u * ((u * ((single(-1.158686483447337) * u) - single(1.7380297251710055))) - single(3.476059450342011)))) * (single(-0.8630462288856506) * s); end
\left(1 + u \cdot \left(u \cdot \left(-1.158686483447337 \cdot u - 1.7380297251710055\right) - 3.476059450342011\right)\right) \cdot \left(-0.8630462288856506 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
Taylor expanded in u around 0
lower-*.f32N/A
lower--.f32N/A
lower-*.f32N/A
lower--.f32N/A
lower-*.f3236.7%
Applied rewrites36.7%
(FPCore (s u) :precision binary32 (+ (* -0.8630462288856506 s) (* u (+ (* 1.5 (* s u)) (* 3.0 s)))))
float code(float s, float u) {
return (-0.8630462288856506f * s) + (u * ((1.5f * (s * u)) + (3.0f * s)));
}
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 = ((-0.8630462288856506e0) * s) + (u * ((1.5e0 * (s * u)) + (3.0e0 * s)))
end function
function code(s, u) return Float32(Float32(Float32(-0.8630462288856506) * s) + Float32(u * Float32(Float32(Float32(1.5) * Float32(s * u)) + Float32(Float32(3.0) * s)))) end
function tmp = code(s, u) tmp = (single(-0.8630462288856506) * s) + (u * ((single(1.5) * (s * u)) + (single(3.0) * s))); end
-0.8630462288856506 \cdot s + u \cdot \left(1.5 \cdot \left(s \cdot u\right) + 3 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
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-*.f3232.2%
Applied rewrites32.2%
(FPCore (s u) :precision binary32 (* (+ 1.0 (* u (- (* -1.7380297251710055 u) 3.476059450342011))) (* -0.8630462288856506 s)))
float code(float s, float u) {
return (1.0f + (u * ((-1.7380297251710055f * u) - 3.476059450342011f))) * (-0.8630462288856506f * s);
}
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 = (1.0e0 + (u * (((-1.7380297251710055e0) * u) - 3.476059450342011e0))) * ((-0.8630462288856506e0) * s)
end function
function code(s, u) return Float32(Float32(Float32(1.0) + Float32(u * Float32(Float32(Float32(-1.7380297251710055) * u) - Float32(3.476059450342011)))) * Float32(Float32(-0.8630462288856506) * s)) end
function tmp = code(s, u) tmp = (single(1.0) + (u * ((single(-1.7380297251710055) * u) - single(3.476059450342011)))) * (single(-0.8630462288856506) * s); end
\left(1 + u \cdot \left(-1.7380297251710055 \cdot u - 3.476059450342011\right)\right) \cdot \left(-0.8630462288856506 \cdot s\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
Taylor expanded in u around 0
lower-*.f32N/A
lower--.f32N/A
lower-*.f3232.2%
Applied rewrites32.2%
(FPCore (s u) :precision binary32 (+ (* -0.8630462288856506 s) (* 3.0 (* s u))))
float code(float s, float u) {
return (-0.8630462288856506f * s) + (3.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 = ((-0.8630462288856506e0) * s) + (3.0e0 * (s * u))
end function
function code(s, u) return Float32(Float32(Float32(-0.8630462288856506) * s) + Float32(Float32(3.0) * Float32(s * u))) end
function tmp = code(s, u) tmp = (single(-0.8630462288856506) * s) + (single(3.0) * (s * u)); end
-0.8630462288856506 \cdot s + 3 \cdot \left(s \cdot u\right)
Initial program 96.0%
lift-log.f32N/A
lift-/.f32N/A
lift--.f32N/A
lift-/.f32N/A
sub-to-fractionN/A
div-flip-revN/A
log-divN/A
lower-unsound--.f32N/A
lower-unsound-log.f32N/A
lower-unsound-log.f32N/A
metadata-evalN/A
lift--.f32N/A
sub-negate-revN/A
add-flip-revN/A
associate-+r-N/A
metadata-evalN/A
lower--.f3296.5%
Applied rewrites96.5%
lift-*.f32N/A
lift--.f32N/A
lift-log.f32N/A
lift-log.f32N/A
diff-logN/A
lift-/.f32N/A
lift-log.f32N/A
lift-log.f32N/A
lift-/.f32N/A
diff-logN/A
lift-log.f32N/A
lift-log.f32N/A
sub-flipN/A
distribute-lft-inN/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lift-*.f32N/A
sum-to-multN/A
Applied rewrites96.2%
Evaluated real constant96.2%
Evaluated real constant96.2%
Taylor expanded in u around 0
lower-+.f32N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3225.8%
Applied rewrites25.8%
(FPCore (s u) :precision binary32 (* (* 3.0 s) -0.28768208622932434))
float code(float s, float u) {
return (3.0f * s) * -0.28768208622932434f;
}
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 = (3.0e0 * s) * (-0.28768208622932434e0)
end function
function code(s, u) return Float32(Float32(Float32(3.0) * s) * Float32(-0.28768208622932434)) end
function tmp = code(s, u) tmp = (single(3.0) * s) * single(-0.28768208622932434); end
\left(3 \cdot s\right) \cdot -0.28768208622932434
Initial program 96.0%
Taylor expanded in u around 0
lower-*.f32N/A
lower-*.f32N/A
lower-log.f327.4%
Applied rewrites7.4%
Evaluated real constant7.4%
lift-*.f32N/A
lift-*.f32N/A
associate-*r*N/A
lift-*.f32N/A
lower-*.f327.4%
Applied rewrites7.4%
(FPCore (s u) :precision binary32 (* 3.0 (* s -0.28768208622932434)))
float code(float s, float u) {
return 3.0f * (s * -0.28768208622932434f);
}
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 = 3.0e0 * (s * (-0.28768208622932434e0))
end function
function code(s, u) return Float32(Float32(3.0) * Float32(s * Float32(-0.28768208622932434))) end
function tmp = code(s, u) tmp = single(3.0) * (s * single(-0.28768208622932434)); end
3 \cdot \left(s \cdot -0.28768208622932434\right)
Initial program 96.0%
Taylor expanded in u around 0
lower-*.f32N/A
lower-*.f32N/A
lower-log.f327.4%
Applied rewrites7.4%
Evaluated real constant7.4%
(FPCore (s u) :precision binary32 (* s -0.863046258687973))
float code(float s, float u) {
return s * -0.863046258687973f;
}
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 * (-0.863046258687973e0)
end function
function code(s, u) return Float32(s * Float32(-0.863046258687973)) end
function tmp = code(s, u) tmp = s * single(-0.863046258687973); end
s \cdot -0.863046258687973
Initial program 96.0%
Taylor expanded in u around 0
lower-*.f32N/A
lower-*.f32N/A
lower-log.f327.4%
Applied rewrites7.4%
Evaluated real constant7.4%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate-*l*N/A
lower-*.f32N/A
metadata-eval7.4%
Applied rewrites7.4%
herbie shell --seed 2025258
(FPCore (s u)
:name "Disney BSSRDF, sample scattering profile, upper"
:precision binary32
:pre (and (and (<= 0.0 s) (<= s 256.0)) (and (<= 0.25 u) (<= u 1.0)))
(* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))